Tony123 Posted February 5, 2014 Share Posted February 5, 2014 (edited) 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/ Edited February 5, 2014 by Tony123 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.