# Mysql auto update?

**URL:** https://forum.kirupa.com/t/mysql-auto-update/180152
**Category:** Uncategorized
**Created:** [February 26, 2006, 5:01am UTC](https://forum.kirupa.com/t/mysql-auto-update/180152 "2006-02-26T05:01:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![The\_Vulcan](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/the_vulcan/32/145_2.png) [@The\_Vulcan](https://forum.kirupa.com/u/The_Vulcan)
#### Post date: [February 26, 2006, 5:01am UTC](https://forum.kirupa.com/t/mysql-auto-update/180152/1 "2006-02-26T05:01:40Z")

</div>

Ok how to put this.

Say you have a forum with millions of posts. When a post is six months old you want it deleted.

**A.** [COLOR=Blue]You make a sript you can run from the admin pannel, log in once a day and run it manually.[/COLOR]

\*\*B. \*\*[COLOR=SeaGreen]Put that script on the home page. Have it check the date the script was last run against todays date. And only run it if it hasn’t be run before.[/COLOR]

[COLOR=SeaGreen] (_so only 1 user a day will have it check through millions of posts rather than every visitor_)[/COLOR]

\*\*C. \*\*[COLOR=Purple]??? This is what I want to know, is there a better way of doing this. Does Mysql have a function to run scripts on a periodic basis without user intervention.[/COLOR]

Is there say a bin that you can get it to check at midnight every night and run whatever scripts are in there ?

Thanks for any tips.
