Answer the question
In order to leave comments, you need to log in
Filling empty IDs in mysql php?
In general, I have a question. Let's say I have a list of users in the database and each has its own ID, the first ID is 0, and the last ID is 21. If you delete a user with ID 8, then how to make the new user have ID 8, not 22 .
Answer the question
In order to leave comments, you need to log in
Don't do nonsense. What does it matter what ID the user has?
excellent soil for growing bugs.
- there was user 8, there was some other data associated with him.
- The user has been deleted, but some data is missing.
- a new user appears, and data from the old user sticks to it.
- you run around in a panic, waving your arms funny
When deleting a user, enter his ID in a special table and when registering a new one, take the ID from there, if there is a free one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question