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