Resurrecting a very old post... I have the same question, i think.
Except i just want to replace the missing numbers and have a nice incremental ID column. IOW, as noted above, if i delete record no. 2, the table looks like this:
no name
1 a
3 c
I want to reindex the table (in PHP) so there are no missing numbers:
no name
1 a
2 c
Seems like there should be a way to do that. Or What about if a variable comes looking for ID #2, and there's no such thing, i set it to #3? Would that be easier?
Oh, wait, what if there's no #3 either... i need to reset the variable to the next increment that does exist. Sorry, i would have posted in the n00b forum but this was where my search brought me.
Thanks
🙂