$sql1="SELECT $table1.*,$table2.*,$table3.* FROM $table1,$table2,$table3 WHERE $table1.cname=$table2.cname And $table1.cname=$table3.cname order by `division`,`section` ";
SELECT table1.*,table2.*,table3.* FROM table1 INNER JOIN table2 ON table1.cname=table2.cname INNER JOIN table3 ON table1.cname=table3.cname WHERE cname='$cname' ORDER BY table1.division,table1.section;
SELECT table1.*,table2.*,table3.* FROM table1 INNER JOIN table2 ON table1.cname=table2.cname INNER JOIN table3 ON table1.cname=table3.cname WHERE table1.cname='$cname' ORDER BY table1.division,table1.section;