I'm working on a booking engine and would like to know if anyone knows the best way to search a db for availability. For example, a customer could search for July 1st 2012 +/-7 days, for a 7 day stay, so the query needs to check that there is no booking, either between the June 24th to July 1st, or June 25th to July 2nd, or June 26th to July 3rd etc., right up to July 7th to July 14th.
My DB at the moment has start and end dates, but I'm simply not sure of the best way to do this...!
Please help! Thanks :-)