RE: [PHP] Reservation technique

From: Date: Fri, 05 Nov 2004 03:32:41 +0000
Subject: RE: [PHP] Reservation technique
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-201252@lists.php.net to get a copy of this message
> 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.

« previous php.general (#201252) next »