So I've been figuring this out for an hour now and I can't seem to find the problem is so i have this code:
$QUERYsubject="select * from tbltablestudent where S_ID='".$myusername."'";
$subject=mysql_query($QUERYsubject) or die(mysql_error());
$QUERYgr1="Select * from ".$subject[Subject].", tbltablestudent where ".$subject[Subject].".S_ID=tbltablestudent.S_ID and tbltablestudent.S_ID='".$myusername."' and Grading_period='1st_Grading'";
$gr1=mysql_query($QUERYgr1) or die(mysql_error());
and I am getting this error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' tbltablestudent where .S_ID=tbltablestudent.S_ID and tbltablestudent.S_ID='sh01' at line 1
-----
Please help me!