Re-number auto-increment column

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Todlerone
Forum Commoner
Posts: 96
Joined: Sun Oct 28, 2007 10:20 pm
Location: Hamilton, Ontario, Canada

Re-number auto-increment column

Post by Todlerone »

Hello everyone. Thank-you in advance for any input into this post. I know it isn't necessary to do, however, I would like to try renumbering my auto-increment primary key. It is a simple 3-digit number that gets alot of adds, alters and deletes.

:lol:
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: Re-number auto-increment column

Post by Kieran Huggins »

This is a really bad idea - you could easily screw up your database, and you really don't need to.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Re-number auto-increment column

Post by pickle »

Unless you're completely emptying that table and all tables that interact with it - don't bother. There's nothing wrong with having a primary key of 40000 (for example).
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Re-number auto-increment column

Post by califdon »

I'll add my endorsement -- unless you are an experienced professional and know precisely what you're doing (and that seems unlikely, or you wouldn't have asked the question), LEAVE IT ALONE.
Post Reply