date_default_timezone_set('Asia/Bangkok'); require_once("../amssplus_connect.php"); mysqli_query($connect,"SET NAMES utf-8"); header('Content-Type: text/html; charset=tis-620'); $sql="select *,count(*) as ngrp,a.id as sid from system_school a,system_school_group b where a.school_group=b.code group by a.school_group order by a.school_group"; $result=mysqli_query($connect,$sql); echo "
ที่ | กลุ่มโรงเรียน | โรงเรียน | User | "; $rw=1; $total=0; while ($db=mysqli_fetch_array($result)) { $sql2="select * from person_sch_main a,system_school b where a.school_code=b.school_code and b.school_group='$db[school_group]' "; $result2=mysqli_query($connect,$sql2); $nuser=mysqli_num_rows($result2); echo "
---|---|---|---|
$rw | $db[name] | $db[ngrp] | $nuser |
รวม | $total | $tuser |