header('Content-Type: text/html; charset=tis-620'); echo ""; include('db_config.php'); mysql_query("TRUNCATE TABLE tmp4sk162"); mysql_query("insert into tmp4sk162 (SELECT * FROM $_data group by kd_sch,kd_code,kd_remark)"); $sql="select *,sum(kd_remark) as rmk from tmp4sk162,$_sch where kd_sch=scode and kd_remark='1' group by kd_sch order by rmk desc"; $result=mysql_query($sql); echo "
ที่ | โรงเรียน | กลุ่ม | ตัวแทน |
$row | $db[sname] | $db[abb_sch] | $db[rmk] |
รวม | $trmk |