header('Content-Type: text/html; charset=tis-620');
include('../db_config.php');
$sql="select * from sk1_sch where scgrp='$sg' ";
$result=mysql_query($sql);
echo "
ที่ |
โรงเรียน |
แจ้งความต้องการ |
";
$rw=1; $tn=0;
while ($db=mysql_fetch_array($result)) {
$sql1="select * from sk1_tdev where tdv_sch='$db[scode]' ";
$result1=mysql_query($sql1);
$n=mysql_num_rows($result1);
if ($n>0) { $ast=$n; } else { $ast='-'; }
echo "
$rw |
$db[sname] |
$ast |
";
$rw++; $tn+=$n;
}
$tstd=number_format($tn,0,'.',',');
echo "
รวม |
$tn |
";
?>