Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
04-18-2004, 07:14 PM #1
- Join Date
- Jun 2002
- Edinburgh, UK
- Thanked 1 Time in 1 Post
Automatic Truncation of MySQL Database
I've a php page that displays a simple list of the users currently logged into my website.
What I want is that this page truncates another MySQL database table, at midnight automatically.
I already now how to connect to the database and to trunctate the table, but i can't work out how to do it automatically at midnight.
Is it possible to set it up so that it automatically does it regardless of whether the page is being displayed? (or should i be asking this part of the question in the MySQL forum?)
Many thanks in advance,Rich
"An expert is a person who has made all the mistakes that can be made in a very narrow field."
04-18-2004, 08:53 PM #2
- Join Date
- Jul 2002
- Thanked 0 Times in 0 Posts
Multiple option. You either write a batchfiel and run mySQL in commandmode to truncate the table, otr you write a PHP page that will do it over the webserver.
For the timer, you need to set up a CRON job (Unix/Linux systems) or Scheduled Task (Windows).
Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html