header('Content-Type: text/html; charset=tis-620'); echo ""; include('db_config.php'); mysql_query("TRUNCATE TABLE tmp4sk161"); mysql_query("insert into tmp4sk161 (select * from $_data group by kd_sch,kd_code,g,s,b)"); $sql="SELECT *,sum(g) AS go,sum(s) AS sv,sum(b) AS bn FROM tmp4sk161,$_sch WHERE kd_sch=scode and level in ('a','k') and kd_cert <> 13 GROUP BY scode ORDER BY go DESC,sv DESC,bn DESC limit 0,10"; $result=mysql_query($sql); echo "
ที่ | โรงเรียน | อ. | ทอง | ตัวแทน |
$row | $scname | $db[abb_amp] | $gg | $rr |