If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Select Query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-26-09, 18:04
zed420 zed420 is offline
Registered User
 
Join Date: Aug 2009
Posts: 3
Select Query

Hi All
Its online calendar(in php) for a driving instructor where by clicking on a day it gives you that day's diary it has time slots from 08:00 to 20:00, all fine till if someone books more than an hr long lesson.
This query below works and avoids all the Overlaping BUT only for the first booking and thereafter it overlaps. Why??? Any thoughts please ???
Zed
Code:
SELECT COUNT(*) AS Cnt   
     FROM booking   
     WHERE request_date='$request_date'   
     AND e_time > '$s_time'   
     AND s_time < '$e_time'
Reply With Quote
  #2 (permalink)  
Old 08-26-09, 20:05
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
saw this before on the other forum, and you have the same problem here -- not enough information

please dump the table layout and a few rows of representative sample data
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On