Timed "auto delete" from Database ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
MiniMonty
Forum Contributor
Posts: 196
Joined: Thu Sep 03, 2009 9:09 am
Location: UK

Timed "auto delete" from Database ?

Post by MiniMonty »

Hi all,

I'm building a site where users will upload content which will only be relevant for a certain period.
Is there a way of setting an "auto delete" on the server / DB to remove the uploaded content after
say, 90 days ?

Best wishes
Monty
JakeJ
Forum Regular
Posts: 675
Joined: Thu Dec 10, 2009 6:27 pm

Re: Timed "auto delete" from Database ?

Post by JakeJ »

Try a cron job and a stored procedure. Run it once a day. the SP will run a DELETE query on records more than 90 days old.
Post Reply