doucigua0449 2013-06-07 20:57
浏览 58

删除不返回原始数字的行

Just working with a database and some tests were done recently which checked the integrity of the setup.

As a result, a lot of test entries were added which were then deleted. However, when new entries are added, the ID number value continues from after the entries added.

What I want: ID increases by one from where it left off before the additional rows were added: 4203, 4204, 4205, 4206 etc.

What is happening: ID increases by one from after the additional rows ID: 4203, 4204, 6207, 6208 6209 etc.

Not sure where to fix this...whether in phpmyadmin or in the PHP code. Any help would be appreciated. Thanks!

  • 写回答

4条回答 默认 最新

  • doukenqiong0588 2013-06-07 21:03
    关注

    I don't think there's a way to do this with an auto-incrementing ID key. You could probably do it by assigning the ID to (select max(id) + 1 from the_table)

    评论

报告相同问题?