MySQL Forums
Forum List  »  PHP

Re: Timing in mysql using php
Posted by: Kai Voigt
Date: July 07, 2005 04:24PM


MySQL cannot do the resetting of table data periodicly. Maybe, we'll get advanced triggers in the future, but for now, you need some external program to perform this task.

Write some PHP/Perl/etc script that sets the column to zero and have this script run periodically by your operating system. Use cron on UNIX or some time scheduling on Windows.

MySQL is not filling gaps when it comes to auto_increment fields. This is actually a feature as you are ensured to have unique values, even if old values are deleted.

You can of course truncate the entire table. This will remove all the table's content and the auto_increment will start at 1 again.


Options: ReplyQuote

Written By
July 06, 2005 11:00AM
Re: Timing in mysql using php
July 07, 2005 04:24PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.