$s=mysql_query("select semester from faculty_advisor where emp_id = 'macs410' ");
echo $s;
$subject=mysql_query("select * from subject_list where semester=$s");
Should be
$s=mysql_query("select semester from faculty_advisor where emp_id = 'macs410' ");
$row = mysql_fetch_assoc($s);
$subject=mysql_query("select * from subject_list where semester='".$row['semester']."'");