$sql="select*from schedule where SUBJECTS_ID='$SUBJECTS_ID' AND PROGRAM='$PROGRAM_NAME' AND LEV='$LEV_NAME' AND YEAR='$YEAR' AND CLASS='$CLASS' AND DAY='$DAY' AND TIME_1='$TIME_1' AND TIME_2='$TIME_2' AND TIME_3='$TIME_3' AND TIME_4='$TIME_4' AND TIME_5='$TIME_5' AND TIME_6='$TIME_6' AND TIME_7='$TIME_7' AND TIME_8='$TIME_8' AND TIME_9='$TIME_9' AND TIME_10='$TIME_10' ";
$query=mysql_query($sql);
$obj=mysql_fetch_array($query);
if($obj!=0)
{
echo"เวลาเรียนมีการทับกันอยู่ กรุณาลงเวลาใหม่";
exit();
}
else
{
........... ลงเวลาได้.........
}
$sql="select*from schedule where SUBJECTS_ID='$SUBJECTS_ID' OR PROGRAM='$PROGRAM_NAME' OR LEV='$LEV_NAME' OR YEAR='$YEAR' OR CLASS='$CLASS' OR DAY='$DAY' OR TIME_1='$TIME_1' AND TIME_2='$TIME_2' OR TIME_3='$TIME_3' OR TIME_4='$TIME_4' OR TIME_5='$TIME_5' OR TIME_6='$TIME_6' OR TIME_7='$TIME_7' OR TIME_8='$TIME_8' OR TIME_9='$TIME_9' OR TIME_10='$TIME_10' ";
$query=mysql_query($sql);
$obj=mysql_fetch_array($query);
if($obj!=0)
{
echo"เวลาเรียนมีการทับกันอยู่ กรุณาลงเวลาใหม่";
exit();
}
else
{
........... ลงเวลาได้.........
}
$sql="select*from schedule where TIME_1='$TIME_1' OR TIME_2='$TIME_2' OR TIME_3='$TIME_3' OR TIME_4='$TIME_4' OR TIME_5='$TIME_5' OR TIME_6='$TIME_6' OR TIME_7='$TIME_7' OR TIME_8='$TIME_8' OR TIME_9='$TIME_9' OR TIME_10='$TIME_10' ";
$query=mysql_query($sql);
$obj=mysql_fetch_array($query);
if($obj!=0)
{
echo"เวลาเรียนมีการทับกันอยู่ กรุณาลงเวลาใหม่";
exit();
}
else
{
........... ลงเวลาได้.........
}