A
A
adrenalinruslan2018-04-16 08:31:10
PHP
adrenalinruslan, 2018-04-16 08:31:10

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

3 answer(s)
R
Ruslan Fedoseev, 2018-04-16
@martin74ua

Don't do nonsense. What does it matter what ID the user has?

S
Stanislav B, 2018-04-16
@S_Borchev

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

P
polyvoidex, 2018-04-16
@polyvoidex

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 question

Ask a Question

731 491 924 answers to any question