Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 21st, 2003, 06:10 PM
Registered User
 
Join Date: Jun 2003
Location: São Paulo, SP, Brazil.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default MySQL AUTO_INCREMENT field

Hi folks!

I'd like to know if someone can help me with the following...
I've got a table in MySQL with an auto_increment field, there's 59 registers, but if I insert one more register the auto_increment field will take the value 65, because I've deleted the registers with the values 60,61,...,64.
How can I reset the counter to make the next value=60?

Thanks!
Fernando.
Reply With Quote
  #2 (permalink)  
Old August 21st, 2003, 06:29 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ALTER TABLE table_name AUTO_INCREMENT = 60;


From the MySQL manual:
  http://www.mysql.com/doc/en/example-AUTO_INCREMENT.html


Take care,

Nik
http://www.bigaction.org/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL script auto_increment vickr1z MySQL 3 January 22nd, 2007 08:22 AM
Mysql auto_increment reset elmb Beginning PHP 2 August 3rd, 2004 07:22 AM
Make an existing field auto_increment Mitch MySQL 1 April 6th, 2004 04:08 AM
Manual Increment MySQL Field cmiller Beginning PHP 4 August 27th, 2003 05:26 PM
How can I change a field name in mysql? scifo Beginning PHP 2 August 1st, 2003 09:41 AM



All times are GMT -4. The time now is 08:57 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.