Problem with auto-incremented “id” column

前端 未结 6 2187
别跟我提以往
别跟我提以往 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:29

    What you want to do is achievable by adding an extra column to your table called something like user_order. You can then write code to manage inserts and deletions so that this column is always sequential with no gaps.

    This way you avoid the problems you could have messing around with an auto_increment column.

提交回复
热议问题