如何取得我的旅行日期hotel_id
,occu_type
,season_start
& season_end
?如何通過匹配我的旅行日期從SQL獲取日期?
如果我的旅行日期介於兩次會話之間,例如我的日期是30/08/2015,31/08/2015,01/09/2015,02/09/2015和03/09/2015。
我使用下面這個在PDO查詢...
$sql = $this->dbObj->query(
select DISTINCT season_start, season_end from nwts_hotel_room_rate
where hotel_id = '".$hotelid."' and occu_type = '".$arrayRmtypeopt."' and
('".$arrardepDate."' >= season_start and '".$arrardepDate."' < season_end)
);
數據庫: -
http://www93.zippyshare.com/v/H33KasNa/file.html http://www39.zippyshare.com/v/KO2qYYyu/file.html
請提供任何解決方案...
我不明白你的問題。爲什麼您需要從查詢中獲得旅行日期,而您已經有了這些日期? – miller
如果你正在使用pdo你應該使用準備好的語句 – Orangepill
並不重要...準備和查詢兩者給出相同的結果... –