สำรวจอาหารกลางวัน ปี 2561
ที่ โรงเรียน นัก
เรียน ราย
งาน "; $rw=1; $nrp=0; while ($db=mysql_fetch_array($result)) { $sql1="select smis,sum(a1+a2+a3+p1+p2+p3+p4+p5+p6) as std,sum(q21+q22+q23) as lun from sk1_lunch61 where smis='$db[smis]' "; $result1=mysql_query($sql1); $db1=mysql_fetch_array($result1); if ($db1[std]>0 and $db1[lun]>0) { $rp=''; $nrp++; } else { $rp=''; } echo " $rw $db[sname] $db1[std] $rp "; $rw++; $tstd+=$db1[std]; } echo " รวม $tstd $nrp "; ?>