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)

    评论

报告相同问题?

悬赏问题

  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教