dubc07 Posted July 31, 2008 Share Posted July 31, 2008 Ok i have been trying to come up w/a solution for this thing. This is the problem. This is what i have so far. <?php $month = 'September'; $day = '10'; $start='600'; $end='900'; $plane = 0; $q = 'SELECT COUNT(*) AS count FROM rentme WHERE `month`="'.$month.'" AND `day`="'.$day.'" AND `plane`="'.$plane.'" AND ( "'.$start.'"BETWEEN starttime AND endtime OR "'.$end.'" BETWEEN starttime AND endtime OR starttime BETWEEN "'.$start.'" AND "'.$end.'")'; $sql = mysql_query($q); $count = mysql_result($sql, 0, 'count'); if ($count > 0) { die('you may not book here'); } echo ' you made it '; ?> On the database i have a plane booked for 700 - 1100 Now the above will not allow a booking from 600 - 900 but if i try and change the start time to over book 700 - 1100 it will book. Is there any way to check and not allow over booking the times? Link to comment https://forums.phpfreaks.com/topic/117618-php-database-verification/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.