Hey guys. How would I go about getting only the rows where a Date field is more than x days old?
For instance, I want to pull out all rows where DateAdded >= 761 days older than today.
I looked up DateDiff and From_days etc..and can't seem to find anything that does this.
Thanks for the help!
Look up the manual entry strtotime() ... should do the trick!!
No, you dont have to mess with php:s date functions and its a lot easier(and even faster too) to use mysql's own:
SELECT * FROM tablename WHERE DateAdded >= DATE_SUB(CURDATE(),INTERVAL 761 DAY)
..that will give you rows that are max 761 days old.