[SOLVED] Calculations using NOW()
Posted: Sun May 15, 2005 3:21 pm
It seems like this should be a simple exercise, but I'm stuck...
My database uses the MySQL timestamp NOW(). I'd like to delete all entries in the database that are older than a certain number of days. At first I tried DATEDIFF in the mysql_query, but later realized that DATEDIFF was added to version 4.1.1 -- my server is running an earlier version of MySQL.
I know how to do this sort of deletion using a unix timestamp, but I'm trying to make it work without going in that direction. Can anyone give me a hint? I'd really like to figure it out on my own, but I need a nudge in the right direction.
Thanks!
My database uses the MySQL timestamp NOW(). I'd like to delete all entries in the database that are older than a certain number of days. At first I tried DATEDIFF in the mysql_query, but later realized that DATEDIFF was added to version 4.1.1 -- my server is running an earlier version of MySQL.
I know how to do this sort of deletion using a unix timestamp, but I'm trying to make it work without going in that direction. Can anyone give me a hint? I'd really like to figure it out on my own, but I need a nudge in the right direction.
Thanks!