I’m currently building a simple userdatabase where I’m using AUTO INCREMENT to get a unique user id. When I delete a single user there will be a gap in the user id. I’m curious if it’s possible to make auto increment fill in these empty gaps instead of using the next highest number:
user id
1000
1001
1002
1004
Right now the next user id I insert into the table will be 1005, but I would like it to be 1003 instead. Is this even possible?
No with autoincrement this is not possible. You will need to manually do it some extra coding.
Normally, if you keep the maxvalue high enough, skipped record wouldn’t be much of a problem.