$sqlyear="Select * From (tabian inner join subject on tabian.sub_id=subject.sub_id) left join grade on tabian.grade_id=grade.grade_id where std_id='$user[id]' and tabian.clas='$result[clas]' and tabian.term='1' order by tabian.sub_id";
$db_year=mysql_db_query($db,$sqlyear);
$resultyear= mysql_fetch_array($db_year);