header('Content-Type: text/html; charset=tis-620'); echo ""; include('db_config.php'); mysql_query("TRUNCATE TABLE tmpkap5"); mysql_query("insert into tmpkap5 (SELECT * FROM $_data group by kd_sch,kd_code,g,s,b,kd_sp)"); $sql="select *,sum(g) as g,sum(s) as s,sum(b) as b from tmpkap5,$_act where kp_code=kd_code and kp_cd like '$grp%' group by kp_code order by kp_act,kd_rank"; $result=mysql_query($sql); echo "
ที่ | รหัส | กลุ่มสาระ | กิจกรรม | รวม | |||
$rw | $db[kp_code] | $db[kp_grp] | $db[kp_act] | $db[g] | $db[s] | $db[b] | $tt |
รวม | $tg | $ts | $tb | $total |