SELECT t1.subjectid, t1.subject, t1.marks, t1.studentid, t2.studentid, t2.studentname as s FROM
list($studentid, $subject, $marks, $s) = $row;
if you look at your two statements here in your sql you have ...
subjectid, subject, marks, studentid, studentid, studentname
in your php you have less then in your mysql statement
subjectid, subject, marks, s
now when you put these into your list you will need the same set of variables to correctly match or your not going to get what you want
so you would need something like this ...
list($subjectid, $subject, $marks, $studentidA, $studentidB, $s);
personally i would not use the list() function but something like
$subjectid = $row['subjectid'];
$subject = $row['subject'];
$marks = $row['marks'];
$s = $row['s'];
this way you know exactly what you are getting for each field that you pull out, even if your sql is updated.