Tony123 Posted February 5, 2014 Share Posted February 5, 2014 Hi everyone, need a bit of guidance in regards to some issues. If Customer A books a room from 01/01/2014 - 05/01/2014 and Customer B books from 03/01/2014 - 05/01/2014, how can I stop a room being double booked on the overlapping dates? Next, Would it be possible to show the availability when the dates have been entered into the form? Finally, would I be able to show something which displays when the hotel limit is reached? Thanks guys, much appreciated! Tony My original post is here: http://forums.phpfreaks.com/topic/285781-applying-date-parameters/ Link to comment https://forums.phpfreaks.com/topic/285969-double-bookings-of-rooms/ Share on other sites More sharing options...
Barand Posted February 5, 2014 Share Posted February 5, 2014 The condition to search for double bookings is A.enddate > B.startdate AND A.startdate < B.enddate You may need <= instead of <. It depends on whether you hold nights booked or checkout date Link to comment https://forums.phpfreaks.com/topic/285969-double-bookings-of-rooms/#findComment-1467880 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.