Re: [PHP] Reset auto_increment field
On Tue, Nov 11, 2003 at 10:34:17AM +0100, Christian Ista wrote: : : It's not really a PHP question, sorry. : : How reset a MySQL auto_incrment field ? There are several suggestions in the User Comments of MySQL's online documentation. You should check them out. http://www.mysql.com/doc/en/example-AUTO_INCREMENT.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reset auto_increment field
Christian Ista wrote: How reset a MySQL auto_incrment field ? ALTER TABLE table_name AUTO_INCREMENT = value -- Pavel a.k.a. Papi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Reset auto_increment field
Hello, It's not really a PHP question, sorry. How reset a MySQL auto_incrment field ? Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reset auto_increment field mysql
It continues incrementing the id field from where it left.. But i found the solution on the web; it's as simple as : TRUNCATE mytable; (which deletes the contents and also resets auto_increment field to 0) Thanks ! On Tue, 12 Mar 2002, Rick Emery wrote: > It worked for me. > > What results did you get? > > > -Original Message- > From: Claudiu [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 12, 2002 8:51 AM > To: [EMAIL PROTECTED] > Subject: RE: [PHP] reset auto_increment field mysql > > > I wish it was that simple... > No.. It doesn't work this way... > > On Tue, 12 Mar 2002, Rick Emery wrote: > > > your query is: DELETE FROM mytable; > > > > -Original Message- > > From: Claudiu [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, March 12, 2002 5:09 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP] reset auto_increment field mysql > > > > > > I have a mysql table which contains an id field which is set to > > auto_increment. > > I have a script which empties this database at regular intervals. > > My problem is that the auto_increment field won't reset to 0 after > > deleting all of tha data, but continue incrementing from where it left. > > > > How can i solve this problem.. > > I want id to reset to 0 when i delete the contents of the table. > > Can someone help? > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reset auto_increment field mysql
It worked for me. What results did you get? -Original Message- From: Claudiu [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 8:51 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] reset auto_increment field mysql I wish it was that simple... No.. It doesn't work this way... On Tue, 12 Mar 2002, Rick Emery wrote: > your query is: DELETE FROM mytable; > > -Original Message- > From: Claudiu [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 12, 2002 5:09 AM > To: [EMAIL PROTECTED] > Subject: [PHP] reset auto_increment field mysql > > > I have a mysql table which contains an id field which is set to > auto_increment. > I have a script which empties this database at regular intervals. > My problem is that the auto_increment field won't reset to 0 after > deleting all of tha data, but continue incrementing from where it left. > > How can i solve this problem.. > I want id to reset to 0 when i delete the contents of the table. > Can someone help? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reset auto_increment field mysql
How about: ALTER table auto_increment=0 > -Original Message- > From: Claudiu [mailto:[EMAIL PROTECTED]] > I wish it was that simple... > No.. It doesn't work this way... > > On Tue, 12 Mar 2002, Rick Emery wrote: > > > your query is: DELETE FROM mytable; > > > > -Original Message- > > From: Claudiu [mailto:[EMAIL PROTECTED]] > > My problem is that the auto_increment field won't reset to 0 after > > deleting all of tha data, but continue incrementing from > where it left. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reset auto_increment field mysql
I wish it was that simple... No.. It doesn't work this way... On Tue, 12 Mar 2002, Rick Emery wrote: > your query is: DELETE FROM mytable; > > -Original Message- > From: Claudiu [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 12, 2002 5:09 AM > To: [EMAIL PROTECTED] > Subject: [PHP] reset auto_increment field mysql > > > I have a mysql table which contains an id field which is set to > auto_increment. > I have a script which empties this database at regular intervals. > My problem is that the auto_increment field won't reset to 0 after > deleting all of tha data, but continue incrementing from where it left. > > How can i solve this problem.. > I want id to reset to 0 when i delete the contents of the table. > Can someone help? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reset auto_increment field mysql
your query is: DELETE FROM mytable; -Original Message- From: Claudiu [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 5:09 AM To: [EMAIL PROTECTED] Subject: [PHP] reset auto_increment field mysql I have a mysql table which contains an id field which is set to auto_increment. I have a script which empties this database at regular intervals. My problem is that the auto_increment field won't reset to 0 after deleting all of tha data, but continue incrementing from where it left. How can i solve this problem.. I want id to reset to 0 when i delete the contents of the table. Can someone help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reset auto_increment field mysql
I have a mysql table which contains an id field which is set to auto_increment. I have a script which empties this database at regular intervals. My problem is that the auto_increment field won't reset to 0 after deleting all of tha data, but continue incrementing from where it left. How can i solve this problem.. I want id to reset to 0 when i delete the contents of the table. Can someone help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php