"; include('db_config.php'); /* $sql0="select * from anb_sch54 where scode='$scid' "; $result0=mysql_query($sql0); $db0=mysql_fetch_array($result0); */ $sql="select * from $_act order by kp_code"; $result=mysql_query($sql); echo <<กิจกรรมแข่งขัน$_title
TH; $rw=1; $total=0; $max; while ($db=mysql_fetch_array($result)) { $act=$db[kp_code]; $sql1="select count(*) as nstd from $_data where kd_code='$act' " ; $result1=mysql_query($sql1); $db1=mysql_fetch_array($result1); if ( $db1[nstd]==0) { $nst='-'; } else { $nst=$db1[nstd]; } echo << TB; $rw++; $total+=$nst; $max+=$db[kp_st]; } $total=number_format($total,0,".",","); echo ""; echo "
ที่ กลุ่มสาระการเรียนรู้ กิจกรรม ชั้น ยอดสมัคร
$rw $db[kp_grp] $db[kp_act] ($db[kp_level]) $db[kp_level] $nst
รวม $total
"; ?>