|
เลือกปีการศึกษา
mysql_query("set NAMES tis620");
if(isset($_GET['year'])) //ถ้าเป็นการเลือกปีครั้งใหม่
{
$txtyear = $_GET['year'];
if($txtyear =='0000') //แสดงทั้งหมด
{
$sql = ("SELECT App_nation from applicants");
}
else
{
$sql = ("SELECT App_nation from applicants where App_year = '$txtyear'");
}
}
else
{
$sql = ("SELECT App_nation from applicants");
}
$result = mysql_query($sql);
$num_rows = mysql_num_rows($result);
$i = 0;
$num1 = 0;
$num2 = 0;
while ($i < $num_rows) {
$fetcharr = mysql_fetch_array($result);
$nation = $fetcharr['App_nation'];
if ($nation == 'ไทย')
$num1++;
else $num2++;
$i++;
}
?> |