hi. i have a MySQL table of users, so when they sign up they are assigned an id number, so the first user gets 1, the second 2, and so on.
well, i created an account through phpmyadmin with id 100000, just to test a few things out. now when a new user makes an account they are given the next numbers up from 100000, so 100001, 100002 etc...
i have deleted the account with id 100000, and all with ids above that, but new accounts are still going up from 100000. I have turned auto-increment off, but then all the new accounts made get id 0. i then turned auto_increment back on, but i still ahve the same problem. what can i do to get new account's IDs starting from the highest numebr currently in the table, as they should?
please help, and thanks for reading.
get auto increment to work at such a number... help :(
Moderator: General Moderators
-
microthick
- Forum Regular
- Posts: 543
- Joined: Wed Sep 24, 2003 2:15 pm
- Location: Vancouver, BC
There is no rule that says that it'll always start at the lowest available number.
To reset the count, you have to remake the table.
Alternatively, you could manually do things the way you want to by making it NOT auto-increment and instead inserting the number yourself. You'd find the number by finding the current max and adding 1.
To reset the count, you have to remake the table.
Alternatively, you could manually do things the way you want to by making it NOT auto-increment and instead inserting the number yourself. You'd find the number by finding the current max and adding 1.
Actually in phpMyAdmin you can change the id auto_increment number. Just do this:
1. Select the table you want
2. Press the "Operations" tab in the right frame
3. Scroll down to the bottom and you will see a box with a number with auto_increment written next to it.
4. Change it to whatever you want and press Go.
**Note: You might want to delete all the entries in the database, I'm not sure what affect this might have if you reach the id numbers already set. It shouldn't be a big deal as long as you have the ID field set to Primary, which will make all ID numbers unique.
1. Select the table you want
2. Press the "Operations" tab in the right frame
3. Scroll down to the bottom and you will see a box with a number with auto_increment written next to it.
4. Change it to whatever you want and press Go.
**Note: You might want to delete all the entries in the database, I'm not sure what affect this might have if you reach the id numbers already set. It shouldn't be a big deal as long as you have the ID field set to Primary, which will make all ID numbers unique.