include "connect.php";
$sql="select * from tb_rentwant WHERE idrentwant='$checkidbring[$i]' and status='1' and ($time0 BETWEEN rentdate or rentdated) or ($time1 BETWEEN rentdate or rentdated)";
$result=mysql_db_query($dbname,$sql);
$num_row= mysql_num_rows($result);
$num_fields= mysql_num_fields($result);
$arr = mysql_fetch_array($result);
$idbring= $arr[idrentwant];
$rentdate = $arr[rentdate];
$rentdated = $arr[rentdated];
if(($time0<=$rentdate or $time0<=$rentdated) or ($time1<=$rentdate or $time1<=$rentdated))
{
echo"(($time0<=$rentdate or $time0<=$rentdated) or ($time1<=$rentdate or $time1<=$rentdated)) มีผู้เช่าก่อนหน้านี้แล้วกรุณาตรวจสอบวันที่อีกครั้งครับ";
$result = mysql_query($sql);
}
else{
echo"(($time0<=$rentdate or $time0<=$rentdated) or ($time1<=$rentdate or $time1<=$rentdated)) จองได้เลยครับ";}
}
ปล. รันแล้ว เออเรอย่างนี้ครับ
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\appserv\www\assrent11.php on line 34
Warning: mysql_num_fields(): supplied argument is not a valid MySQL result resource in c:\appserv\www\assrent11.php on line 35
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\appserv\www\assrent11.php on line 39