問題出在下面的查詢SQL查詢時用PHP
$query1 = "SELECT SUM(qyt) FROM vip_allotment_details
where allotment_id = (SELECT id from vip_allotment
where date_from >= '2017-10-1' AND
date_to <= '2017-10-31') ";
當我穿上DATE_TO值超過二零一七年十月十五日它收到以下錯誤
Warning: mysql_query(): Unable to save result set in /home/saudican/public_html/hotel/pages/r_booking_status.php on line 133
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/saudican/public_html/hotel/pages/r_booking_status.php on line 136
我想不通的地方是查詢的問題...
也許子查詢返回多行。嘗試'allotment_id IN(...)'而不是 – GurV
@GurwinderSingh非常感謝你的工作..謝謝你。 –
不客氣。 – GurV