One method would be to use the following query for each day
Code:
SELECT COUNT(*)
FROM tablename
WHERE calendar_startdate <= 2009-08-09
AND calendar_enddate >= 2009-08-09
This will then fetch the number of bookings on that date, if there is a count of more than 1 then you know the date can not be booked.
I would also create seperate indexs on both date fields to speed up the search. The reason you do a COUNT(*) is because it is a LOT quicker to count the number of rows than it is to fetch data and use a mysql_num_rows, infact if you benchmark this for a year (365) it still takes less time than it does for mysql_num_rows to do the same task for a month!
Bookmarks