RE: [PHP] Reservation technique
| From: | Roger Thomas | Date: | Fri, 05 Nov 2004 03:30:28 +0000 |
| Subject: | RE: [PHP] Reservation technique | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-201254@lists.php.net to get a copy of this message | ||
Great! Thanks Murray.
--
roger
Quoting "Murray @ PlanetThoughtful" <lists@planetthoughtful.org>:
>
> > How will a PHP script perform such checking to prevent that sort of
> > overlapping in reservation ? Or could it be that my database design is bad
> > that's blocking ideas into my head ?
>
> Hi Roger,
>
> I think you need to check out the BETWEEN operator in MySQL (assuming you're
> using MySQL? Look for the equivalent operator in whatever db platform you're
> using, if otherwise). Essentially what you're looking to do is find out if
> either the start time or the end time of the new booking falls BETWEEN the
> start time or the end time of an existing booking. If either of them does,
> it's safe to assume there's a booking conflict.
>
> Much warmth,
>
> Murray
> http://www.planetthoughtful.org
> Building a thoughtful planet,
> One quirky comment at a time.
>
>
---------------------------------------------------
Sign Up for free Email at http://ureg.home.net.my/
---------------------------------------------------