HI. I'm stuck with this for a long time now. If you can, please help me.
I'd like to select rooms of a certain hotel in a certain time period, and display the availability of these in a calendar this way:
(see attachement: sceenshot.gif)
I have the following database design:
host_booking
bookingid
roomid
hotelid
startdate
enddate
guests
host_room
roomid
hotelid
roomname
beds
host_hotel
hotelid
hotelname
- If user search for 3 nights, I'd like to display 5 nights in the calendar. One night before the requested startdate and one night after the requested enddate.
- In table booking there are records only when a reservation is made and there can be many records with the same roomid (with different date intervals of course).
- startdate and enddate are DATE type fields.
- Input values are: $startdate, $nights, $hotelid when search is made.
- I have MYSQL 4.0.22-standard so I can't use subqueries. I usually use multi dimensional 'while' instead.
I also attached an sql dump.
Please, give me some solution.
Thanks.