> "SELECT id FROM dates WHERE FROM_UNIXTIME($date_string) = date"
> 
> then
> 
> "SELECT id FROM dates WHERE UNIX_TIMESTAMP(date) = $date_string"
> 
> neither is working. Am I making some fundamental error here or missing
> something? Any help appreciated!

I know yui've alreayd solved this, but for what it's worth, the first
form of statement is preferred to the second.

In the second you are applying a MYSQL function to a field which will
have to be repeated many times, in the first, you are applying a MYSQL
function to a constant which only has to be computed once.

Even now you have the solution, it may be worth considering the order of
your check and if possible use the MYSQL function ont he constant not
the field to get the additional performance gain.

Col.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to