I have a mysql table with fields for a start and end date/time.
How would i select just the rows that are older than the current date using php.
The format of the end-date is 2009-11-25 08:01:00
and the field type is datetime
I have a mysql table with fields for a start and end date/time.
How would i select just the rows that are older than the current date using php.
The format of the end-date is 2009-11-25 08:01:00
and the field type is datetime
Provided timestamps and the MySQL are in the same timezone, you can just compare to NOW()
.
SELECT * FROM tbl WHERE date_col < NOW()