getting dates from 2 booking tables to display as booked
Posted: Tue Dec 23, 2003 4:59 am
Hi there
i'm fairly new to php so be gentle
I am doing a booking sytem for a motorhome company that has two motorhomes. I have 2 tables in my db (one for each motorhome) that record the dates booked by the user. The user can view a calendar that shows when dates are booked. However this only works currently by querying one of the booking tables. I would like to update the calendar so it queries both tables. So say if january is completely booked up in the book1 table yet is completely free on book2 then i still want the calendar to show the dates as free.
Currently i 'm playing around with the idea of two sql queries that select dates from book1 and dates from book2 and then give the results in an array. Then i'm using an if statement that says if book1 dates match up with book2 dates then show as booked on the calendar. Obviously this is not working at the moment but i just need someone to say whether i'm on the right lines or just heading up a deep dark dead end. Thanks in advance for any help.
i'm fairly new to php so be gentle
I am doing a booking sytem for a motorhome company that has two motorhomes. I have 2 tables in my db (one for each motorhome) that record the dates booked by the user. The user can view a calendar that shows when dates are booked. However this only works currently by querying one of the booking tables. I would like to update the calendar so it queries both tables. So say if january is completely booked up in the book1 table yet is completely free on book2 then i still want the calendar to show the dates as free.
Currently i 'm playing around with the idea of two sql queries that select dates from book1 and dates from book2 and then give the results in an array. Then i'm using an if statement that says if book1 dates match up with book2 dates then show as booked on the calendar. Obviously this is not working at the moment but i just need someone to say whether i'm on the right lines or just heading up a deep dark dead end. Thanks in advance for any help.