I want to know how to delete records from a MySQL Database after 1 week
This is the code I have for inserting the record and date of when it was added
INSERT INTO moviesdone VALUES ('" . $id2 . "', NOW())
Where $id is the name of what I am insterting and wanting to delete after 1 week.
I would also like to do this automatically, which I can set up from in phpMyAdmin
So, I only need to know: How do I write the date correctly (if needed) and how do I delete the record one week later?
Run this code at regular intervals, for example once per day:
You can use the event scheduler.