I am trying to insert student exam answers to a table online_exam_marks. I stored $_POST values after ensuring that $_POST value is not empty and if they empty I just set it to $a = '0' to different variables i.e $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";
when this executes it always returns prints error. please help.