Pada Sun, 25 Aug 2002 15:24:43 +0100
"Ray Healy (Data Net Services)" <[EMAIL PROTECTED]> menulis :
>
> The one thing I cannot get into my head is how can you tell the database
> that all the days between the "start" and "end" dates are booked.
> Also when
> people search for a caravan on a specific date and say they want it for 7
> day the database/PHP checks to see if the entire period is totally free for
> them and does not colide with another booking.
just do query ....
select count(*) from booking where booking_start <= "$wanna_book_start_date" and
booking_end >= "$wanna_book_start_date" and villa_id = "something";
if the results is not 0 then there is someone book the caravan on that date.
--
Write clearly - don't be too clever.
- The Elements of Programming Style (Kernighan & Plaugher)
MySQL 3.23.51 : up 66 days, Queries : 356.493 per second (avg).
--
Dicky Wahyu Purnomo - System Administrator
PT FIRSTWAP : Jl Kapt. Tendean No. 34 - Jakarta Selatan 12790
Phone : +62 21 79199577 - HP : +62 8551044244 - Web : http://www.1rstwap.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php