I'm having the a date stored in my db in yyyy/dd/mm format. I want all the entries older than 2 weeks to be deleted from the db. How can i do the calculations to find if the entry was added more than 2 weeks ago?
You do have it in a datefield?
yes
This query is untested, but should do what you want:
DELETE FROM `table` WHERE DATE_SUB(CURDATE(), INTERVAL 14 DAY) > date_col;
For more information on working with dates in MySQL, visit the manual page for Date and Time Functions.
yeah it does exactly what i need. thank you!