$sql = "SELECT book_id FROM booking where status='1' or status='2' and check_in <= $checkout and check_out >= $checkin order by book_id asc";
$result=mysql_db_query($newDB,$sql);
$N = mysql_num_rows($result); //$N=นับจำนวนแถวที่ได้ตามเงื่อนไข $sql
while ($row1=mysql_fetch_array($result)){
$book_id=$row1['book_id'];
echo $book_id. ",";
}
Tag : - - - -
Date :
2009-11-12 11:04:43
By :
giroo
View :
1352
Reply :
8
No. 1
Guest
$sql = "SELECT book_id FROM booking where status='1' or status='2' and check_in <= $checkout and check_out >= $checkin order by book_id asc";
$result=mysql_db_query($newDB,$sql);
$N = mysql_num_rows($result); //$N=นับจำนวนแถวที่ได้ตามเงื่อนไข $sql
$i = 1;
$tmpCODE="";
while ($row1=mysql_fetch_array($result)){
$book_id=$row1['book_id'];
$tmpCODE += $book_id;
$tmpCODE+= ",";
if($i==$N){
$tmpCODE+= "";
}