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


Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail

Reply via email to