header('Content-Type: text/html; charset=tis-620'); echo ""; include('db_config.php'); mysql_query("TRUNCATE TABLE tmp3sk162"); mysql_query("insert into tmp3sk162 (SELECT * FROM $_data group by kd_sch,kd_code,kd_remark)"); $sql="SELECT kd_code, kd_sch,sname,scode,abb_sch,sum(kd_remark) as rmk FROM tmp3sk162,$_sch WHERE kd_sch=scode GROUP BY scode ORDER BY rmk DESC limit 0,10"; $result=mysql_query($sql); echo "
ที่ | โรงเรียน | กลุ่ม | ตัวแทน |
$row | $db[sname] | $db[abb_sch] | $db[rmk] |