Re: [PHP] php/mySQL time comparison

2003-03-14 Thread CPT John W. Holmes
> Try quoting your dates - you could also edit your code by using the > BETWEEN SQL keywors. Using the less than / greater than method is slightly faster and probably more portable. I don't know how many databases implement BETWEEN. ---John Holmes... -- PHP General Mailing List (http://www.php

Re: [PHP] php/mySQL time comparison

2003-03-14 Thread Brad Wright
Thanks people, thank you very very much. the missing quotes were the problem. Can't beleive I kept missing that, everytime I re-read the code. Sorted now, and I've still got some hair!! You people are legends!!! Cheers, Brad Nel vino la verità, nella birra la forza, nell'acqua i bacilli -

Re: [PHP] php/mySQL time comparison

2003-03-14 Thread php-editors.com
Try quoting your dates - you could also edit your code by using the BETWEEN SQL keywors. hope this helps |-| |- www.php-editors.com| |- php programming contests | |- php tool reviews | |- php everything else| |-|

Re: [PHP] php/mySQL time comparison

2003-03-14 Thread Jason Wong
On Friday 14 March 2003 22:33, Brad Wright wrote: > I want to pull all data out of a mysql table that falls between two dates > (a start-time and end-time). > > I use PHP to allow the user to specify the time interval, creating 2 > variables > 'startTime' and 'endTime'. These are formatted thus: 2

Re: [PHP] php/mySQL time comparison

2003-03-14 Thread CPT John W. Holmes
$timeFrom and $timeTo need to be surrounded by quotes within your SQL query for the format you're using. $query = "select * from Job_TB where teamNo = $teamNo AND startTime >= '$timeFrom' AND endTime <= '$timeTo'"; ---John Holmes... - Original Message - From: "Brad Wright" <[EMAIL PROTEC