Not auto-incrementing correctly

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
thefreebielife
Forum Contributor
Posts: 126
Joined: Thu Apr 26, 2007 2:59 pm

Not auto-incrementing correctly

Post by thefreebielife »

this is my database table info:

Code: Select all

  `uId` int(6) NOT NULL auto_increment,
Now i have admin preinstalled for uId = 1

But when users join, their uId's are like 7000 (needed for a different DB).

I cannot figure out how to change this for this particular DB to make the next user be 2 and so on.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It probably is auto-incrementing correctly, but not how you assumed it would.

You will need to alter the table. We've had several posts on this subject before, please seek them out using the hints I've given.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

You can change where the auto_increment is currently starting at.

Code: Select all

alter table `table` set auto_increment = ?
Post Reply