echo ""; include('header.php'); header('Content-Type: text/html; charset=tis-620'); include_once('db_config.php'); $sql="select * from $_act order by kp_id"; $result=mysqli_query($con,$sql); $db=mysqli_fetch_array($result); $gp=$db[kp_grp]; echo "
| ที่ | ประเภทกีฬา | เหรีญทอง (ตัวแทนจังหวัด) | เหรียญเงิน | เหรียญทองแดง | |||
| $rw | $db[kp_grp] รุ่น $db[kp_age] ปี $db[kp_act] | "; $sql1="select * from $_data,$_sch where kd_sch=scode and kd_code='$db[kp_code]' and g='1' and kd_rank=1 "; $result1=mysqli_query($con,$sql1); if ($db1=mysqli_fetch_array($result1)) { echo "รร.$db1[sname] "; } else { echo " | "; }
/*
$result1=mysqli_query($con,$sql1);
while ($db1=mysqli_fetch_array($result1)) {
echo "$db1[kd_std] "; } */ echo " | ";
$sql1="select * from $_data,$_sch where kd_sch=scode and kd_code='$db[kp_code]' and (s='1' or kd_rank=2) ";
$result1=mysqli_query($con,$sql1);
if ($db1=mysqli_fetch_array($result1)) {
echo "รร.$db1[sname] "; } else { echo " | "; }
/*
$result1=mysqli_query($con,$sql1);
while ($db1=mysqli_fetch_array($result1)) {
echo "$db1[kd_std] "; } */ echo " | ";
$sql1="select * from $_data,$_sch where kd_sch=scode and kd_code='$db[kp_code]' and (b='1' or kd_rank=3) ";
$result1=mysqli_query($con,$sql1);
if ($db1=mysqli_fetch_array($result1)) {
echo "รร.$db1[sname] "; } else { echo " | "; }
/*
$result1=mysqli_query($con,$sql1);
while ($db1=mysqli_fetch_array($result1)) {
echo "$db1[kd_std] "; } */ echo " |