查询始终使用php失败

时间:2016-12-08 04:07:41

标签: php mysql

我正在尝试将学生的答案插入表格online_exam_marks,其结构为enter image description here

。我获取了$ _POST值并存储在不同的变量中,例如$a,$b,...$stu_id = $_SESSION["id"]; 执行查询

$sql =  "INSERT INTO online_exam_marks (stu_id , 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) VALUES ( '$stu_id' ,'$a', '$b','$c','$d','$e','$f','$g','$h','$i','$j')";
    if(mysqli_query($con,$sql))
    {
        render("success.php");  
    }
    else echo "error"; 

执行此操作时,始终会输出错误。 请帮忙。

0 个答案:

没有答案