i have this query where i want to insert all the variable in 3 separate table. but the alert says fail to submit but when i debug using var_dump() it seems like all the value successfully hold by the query. i already separate the query using ';' but nothing works.
here the query:
$query = "INSERT INTO tb_SCSP4114u(studID, attendance, commitment, decipline, rnr, socialization, manner, nvc, frequency, comment, totalscore)
VALUES ('$sc', '$attendance', '$Commitment', '$Dicipline', '$rnr', '$Socialization', '$Manner', '$nvc', '$Frequency', '$comment1', '$tscore1');
INSERT INTO tb_4124u(studID, pot, iop, ioo, tka, tpp, we, ec, bl, vs, o, c, comment, tscore)
VALUES ('$sc', '$task', '$problem', '$obj', '$tka', '$tpp', '$work', '$eye', '$body', '$vs', '$Organization', '$Creativity', '$comment2', '$tscore2');
INSERT INTO tb_4134u(studID, ons, ct, snf, cd, cr, pl, op, comment, tscore)
VALUES ('$sc', '$ons', '$ct', '$lv', '$snf', '$cd', '$cr', '$Plagiarism', '$pw', '$comment3', '$tscore3');";
//var_dump($query);
if (mysqli_multi_query($con, $query))
{
echo '<script> alert("Assessment Successfully Submitted\n\n");window.location="unicindex.php"</script>';
}
else
{
echo '<script> alert("Assessment Failed to submit\n\n");window.location="assessmentuc.php"</script>';
}
mysqli_close($con);
here is the debug result:
string(581) "INSERT INTO tb_SCSP4114u(studID, attendance, commitment, decipline, rnr, socialization, manner, nvc, frequency, comment, totalscore) VALUES ('A14CS0099', '5', '5', '5', '5', '5', '5', '5', '5', 'SDX', '40');
INSERT INTO tb_4124u(studID, pot, iop, ioo, tka, tpp, we, ec, bl, vs, o, c, comment, tscore) VALUES ('A14CS0099', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', 'dcsc', '55');
INSERT INTO tb_4134u(studID, ons, ct, snf, cd, cr, pl, op, comment, tscore) VALUES ('A14CS0099', '5', '5', '5', '5', '5', '5', '5', '5', 'dwce', '40');"