Click to See Complete Forum and Search --> : Auto increment in mysql


ketanco
10-03-2008, 09:39 PM
In mysql, my primary key is id column and it is autoincrement. sometimes i do a mistake when entering something and when i delete the last row, the utoincrement keeps counting for the next row. for example, if i delete the row with id =37, the next row does not become 37, but keeps counting from 38. how can i make the next row count from where it left, so that there wont be any gaps between id numbers? because this way whenever i make a mistake and have to delete a latest entry, the id number keeps counting. OR it really doesnt matter ?

skywalker2208
10-03-2008, 09:44 PM
It shouldn't really matter.

felgall
10-03-2008, 10:37 PM
If the value in the field is supposed to have a particular meaning then you shouldn't use autoincrement.