Quote:
Originally posted by Jakeman
I tried that. You can't compare strings like that.
2002-12-15 >= 2002-12-18 doesn't work.
|
This
should work in MySQL... or at least, it has worked in scripts I have written in the past. If a MySQL field is of the DATE type, the software knows how to compare one date to another.
However, there is another, slightly cleaner option, now that I think about it. Try this:
PHP Code:
SELECT whatever FROM table WHERE UNIX_TIMESTAMP() >= UNIX_TIMESTAMP(date_field);
Give that a shot and let me know if it works.
Note that the UNIX_TIMESTAMP() function returns the current timestamp when called with no argument.