我正在使用全日历的酒店预订系统,我只想选择可用的房间,但是当我添加查询以选择可用的房间时,日历消失了。我有两个表:table room('id','name')
和table reservation('id','id_room','start','end')
。我要选择的查询是:
$sql = "SELECT
*
FROM room
WHERE id
NOT IN (
SELECT id_room
FROM
reservation
WHERE end< FROM_UNIXTIME(:end)
AND start >= FROM_UNIXTIME(:start)
ORDER BY
start ASC
)";