Problem with auto-incremented “id” column

前端 未结 6 2184
别跟我提以往
别跟我提以往 2021-01-06 01:26

My db table looks like this pic. http://prntscr.com/22z1n

Recently I\'ve created delete.php page. it works properly but when i deleted 21th user next registered use

6条回答
  •  情歌与酒
    2021-01-06 02:33

    Easily, no. What you can do (but I don't suggest doing) is making an SQL function to determine the lowest number that isn't currently occupied. Or you can create a table of IDs that were deleted, and get the smallest number from there. Or, and this is the best idea, ignore the gaps and realize the database is fine.

提交回复
热议问题