如何取得我的旅行日期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
并不重要...准备和查询两者给出相同的结果... –