> 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
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
-
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|
|-|
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
$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
5 matches
Mail list logo