Can anyone tell me how to flush a MySQL databse every hour?
I want to put up a demo CMS so users can input data and change things, but then I want to clear all the imput data out t timed intervals?
Thanks in advance
Can anyone tell me how to flush a MySQL databse every hour?
I want to put up a demo CMS so users can input data and change things, but then I want to clear all the imput data out t timed intervals?
Thanks in advance
keep track when it was last run if it's greater than an hour delete the data in the database. otherwise continue.
www.squitosoft.com - PHP development site. featuring Squito Gallery. a php driven photo gallery.
www.rgfx.net - Specializing in Internet solutions, including Html authoring, Interactive Web sites, 3D/2D Graphics and animation.
Sorry, Redcircle, I didn't explain that I wanted to do it automatically at 1 hour intervals.
ok... doing some thinking on your problem I have a better solution. Instead of having it truncate on a set interval why not truncate at the start of every session to the CMS. That way if someone is in the middle of testing the CMS and your 1hour interval comes about then they are going to be confused. Then again if you have more than one person doing the demo they will also be confused...
Personally instead of an hourly flush I'd do a daily flush that way people that are using the demo can get an idea of what others were trying out.
to completely answer your question on a periodic flush you could use a cron job to flush the data every hour.
Here's some information on another forum on the subject http://forums.devshed.com/t5948/s.html
www.squitosoft.com - PHP development site. featuring Squito Gallery. a php driven photo gallery.
www.rgfx.net - Specializing in Internet solutions, including Html authoring, Interactive Web sites, 3D/2D Graphics and animation.
Hey, Redcircle, you're the ACE man!