Had a search for this but the solutions I found did not take into account the fact that I have an ID in the table which is higher than what I want the auto increment to reset to.
Basically, I have a table of dog breeds, which are pulled out into a form in my site for users to select, and currently there are two:
----------------------
| ID | Name |
----------------------
| 1 | French Bulldog |
----------------------
| 2 | Labrador |
-----------------------
But I also need to have an "Other" record, which ALWAYS needs to be last in the list of breeds to be pulled out on the front end. So, I have assigned an ID of 9999 to the Other breed, so the table looks like this:
------------------------
| ID | Name |
------------------------
| 1 | French Bulldog |
------------------------
| 2 | Labrador |
-------------------------
| 9999 | Other |
-------------------------
But I want to be able to add other breeds to the table, but I'd want the auto increment to start from 3. So I used the following:
ALTER TABLE breed AUTO_INCREMENT = 3
It doesn't return any errors but when I add a new entry, it begins at 10000 instead of 3. This means that "Other" will always be the third in the list and not last as I need it to be.
Is there any way of making it begin increment from 3 despite the fact there is an ID of 9999 already in the table?