Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- Order by timestamp WITH simple math calculation


Dijkgraaf - 1:26 am on Jul 15, 2012 (gmt 0)


UNIX_TIMESTAMP is a PHP command, so you need to either

1) execute that on the PHP side
"SELECT *
FROM $tbl_foo
WHERE (fld_approved + 259200) < " + UNIX_TIMESTAMP + "
ORDER BY fld_approved
LIMIT 0, 10";
2) replace UNIX_TIMESTAMP with NOW()

"SELECT *
FROM $tbl_foo
WHERE (fld_approved + 259200) < NOW()
ORDER BY fld_approved
LIMIT 0, 10";

My preference is for option 2.


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/4475614.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com