First of all I know php mysql_* functions are depreciated, but my supervisor wants me to use the regardless.
In this piece of code everything is running fine, except the line: $insert =
"insert into match (t_id, s_id) values ('$tutor_id', '$student_id')";
The data is printed out correctly using the line:
echo "<script>alert('$tutor_id, $student_id')</script>";
However the data still won't go into the table "match". I can't figure this out
Any help would be greatly appreciated.
mysql_query($insert);
$run_6 = mysql_query("select tutors.tutor_id, students.student_id
from tutors, students
where tutor_availability = '$student_availability'
AND (tutor_subject_1 = '$student_subject_1'
OR tutor_subject_1 = '$student_subject_2'
OR tutor_subject_2 = '$student_subject_2'
OR tutor_subject_2 = '$student_subject_1')");
while($row = mysql_fetch_row($run_6)) {
$tutor_id = $row[0];
$student_id = $row[1];
echo "<script>alert('$tutor_id, $student_id')</script>";
$insert = "insert into match (t_id, s_id) values ('$tutor_id', '$student_id')";
mysql_query($insert);
}