RE: [PHP-DB] how can reset value of auto_increment field

From: Date: Sun, 04 May 2003 22:47:15 +0000
Subject: RE: [PHP-DB] how can reset value of auto_increment field
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-27521@lists.php.net to get a copy of this message
> i am develop a site, my database have data, when i delete all data and > insert > new data the auto_increment field continue with the old value ( befor > delete) > > so , how can i use alert command via php . You mean ALTER? Same way as you use SELECT, UPDATE and any other SQL statement. First of all, there is no need to do this. Second, if you insist, use: ALTER TABLE <table_name> AUTO_INCREMENT = 1 To reset the auto_increment counter back to one. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/

« previous php.db (#27521) next »