change to local mysql
This commit is contained in:
@@ -59,7 +59,7 @@
|
|||||||
<div class="nav-wrapper container">
|
<div class="nav-wrapper container">
|
||||||
<div style="text-align:center;display:inline-block;padding:5px 0;width:100%;float:left;">本次答题结束<span name="remtime">
|
<div style="text-align:center;display:inline-block;padding:5px 0;width:100%;float:left;">本次答题结束<span name="remtime">
|
||||||
<?php
|
<?php
|
||||||
$con=mysqli_connect("172.27.16.2:3306","root","lxo329123456","buptStudent");
|
$con=mysqli_connect("127.0.0.1:3306","buptStudent","buptStudentlx","buptStudentdb");
|
||||||
if (!$con){echo 'Could not connect:' . mysql_error();};
|
if (!$con){echo 'Could not connect:' . mysql_error();};
|
||||||
$result2 = mysqli_fetch_array(mysqli_query($con,"SELECT * FROM UserAnswer WHERE Student_ID = '$_SESSION[Student_ID]'"));
|
$result2 = mysqli_fetch_array(mysqli_query($con,"SELECT * FROM UserAnswer WHERE Student_ID = '$_SESSION[Student_ID]'"));
|
||||||
if($result2[score]) echo "得分为: ".$result2[score]*5." ";
|
if($result2[score]) echo "得分为: ".$result2[score]*5." ";
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<?php
|
<?php
|
||||||
//link to mysql
|
//link to mysql
|
||||||
$con=mysqli_connect("172.27.16.2:3306","root","lxo329123456","buptStudent");
|
$con=mysqli_connect("127.0.0.1:3306","buptStudent","buptStudentlx","buptStudentdb");
|
||||||
if (!$con){echo 'Could not connect:' . mysql_error();};
|
if (!$con){echo 'Could not connect:' . mysql_error();};
|
||||||
//mysql_select_db("my_db_test", $con);
|
//mysql_select_db("my_db_test", $con);
|
||||||
$p = 20;
|
$p = 20;
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ if($_SESSION[Student_ID] != ""){
|
|||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
//link to mysql
|
//link to mysql
|
||||||
$con=mysqli_connect("172.27.16.2:3306","root","lxo329123456","buptStudent");
|
$con=mysqli_connect("127.0.0.1:3306","buptStudent","buptStudentlx","buptStudentdb");
|
||||||
if (!$con){die('Could not connect:' . mysql_error());};
|
if (!$con){die('Could not connect:' . mysql_error());};
|
||||||
//mysql_select_db("my_db_test", $con);
|
//mysql_select_db("my_db_test", $con);
|
||||||
$p = 20;
|
$p = 20;
|
||||||
@@ -151,6 +151,7 @@ if($_SESSION[Student_ID] != ""){
|
|||||||
}
|
}
|
||||||
if($flag == 0){
|
if($flag == 0){
|
||||||
$i--;
|
$i--;
|
||||||
|
sleep(0.5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
test.php
2
test.php
@@ -8,7 +8,7 @@
|
|||||||
$m = floor($sec/60);
|
$m = floor($sec/60);
|
||||||
$s = floor($sec%60);
|
$s = floor($sec%60);
|
||||||
//link to mysql
|
//link to mysql
|
||||||
$con=mysqli_connect("172.27.16.2:3306","root","lxo329123456","buptStudent");
|
$con=mysqli_connect("127.0.0.1:3306","buptStudent","buptStudentlx","buptStudentdb");
|
||||||
if (!$con){die('Could not connect: '.mysql_error());}
|
if (!$con){die('Could not connect: '.mysql_error());}
|
||||||
//mysql_select_db("my_db_test", $con);
|
//mysql_select_db("my_db_test", $con);
|
||||||
//name & student_id
|
//name & student_id
|
||||||
|
|||||||
Reference in New Issue
Block a user