Hi,
I'm trying to set up a booking system and can't quite get my head around this. The bookings table looks like thus:
'Arrival' and 'Departure' are in the format YYYY-MM-DD (2010-01-15 for example).
It should only allow one booking in a given period. So the table may look like this:
I need to run a check past the table to see if a slot is available or not, so if a client were to try and book 2010-01-16 until 2010-01-25, it would say no.
I've tried toying around with unix timestamp (I figured that may be an easier route to take?) but haven't had much luck.
Any ideas how this could be tackled?
Cheers
I'm trying to set up a booking system and can't quite get my head around this. The bookings table looks like thus:
Code:
id | arrival | departure
'Arrival' and 'Departure' are in the format YYYY-MM-DD (2010-01-15 for example).
It should only allow one booking in a given period. So the table may look like this:
Code:
1 | 2010-01-15 | 2010-01-20
2 | 2010-01-21 | 2010-01-22
3 | 2010-01-24 | 2010-02-01
I need to run a check past the table to see if a slot is available or not, so if a client were to try and book 2010-01-16 until 2010-01-25, it would say no.
I've tried toying around with unix timestamp (I figured that may be an easier route to take?) but haven't had much luck.
Any ideas how this could be tackled?
Cheers