diff --git a/test.php b/test.php index 2bc8fb6..3783c36 100644 --- a/test.php +++ b/test.php @@ -7,12 +7,12 @@ $m = floor($sec/60); $s = floor($sec%60); //link to mysql - $con = mysqli_connect("localhost","buptStudent","buptStudentlx","buptStudentdb"); + $con=mysqli_connect("localhost","buptStudent","buptStudentlx","buptStudentdb"); if (!$con){die('Could not connect: '.mysql_error());} //mysql_select_db("my_db_test", $con); //name & student_id $chongfu="SELECT Student_ID FROM UserAnswer WHERE Student_ID=$_POST[student_id]"; - if(mysql_fetch_array(mysql_query($chongfu,$con))[0]==$_POST[student_id]) + if(mysqli_fetch_array(mysql_query($chongfu,$con))[0]==$_POST[student_id]) { die('对不起,您已参与过本活动。'); }