MySQL, how can I only select rows that are older than a week?
I need to do this in order to create a system that deletes the old tmp files that I have saved in the database.
Try it,
select * from table where DATEDIFF(now(),colname) > 7;
select * from table where (SELECT DATEDIFF(curtime(),col_name)) > 7
SELECT * FROM `table` WHERE `created` < dateadd(week,-1,getdate())