boooking: get available dates
| From: | amanda kerdal | Date: | Thu, 12 Feb 2004 14:07:38 +0000 |
| Subject: | boooking: get available dates | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-32915@lists.php.net to get a copy of this message | ||
Hi everyone
trying to do an e-booking service for BBs.
In mysql db I've got a booking table with an arrivalDate and a departureDate field for each
Unit booked. My Units are the Rooms and in the Unit table.
I want to check availability for every single unit.
$result_dates=mysql_query("SELECT unit_ID FROM bookings WHERE unit_ID!=0
AND(arrivalDate<=$arrivalDate AND $arrivalDate<=departureDate OR
arrivalDate<=$departureDate AND $departureDate<=departureDate OR $arrivalDate<=arrivalDate
AND arrivalDate<=$departureDate OR $arrivalDate<=departureDate AND
departureDate<=$departureDate)");
Is right to proceed like that?
thanks for any piece of help
Mandy
---------------------------------
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail