阅读背景:

如何防止自动增量跳过数据库中的id号?

来源:互联网 

Okay, so let's say I have a mysql database table with two columns, one is for id and the other is for password. If I have three rows of data and the id values go from 1 to 3 and I delete row 3 and then create another row of data, I will see id=4 instead of id=3 on the newly created row. I know this has to do with the auto increment value but I was wondering if I can add some code in a php file that will automatically reset all the id numbers such that you start at id=1 and go up to the last id number in increments of 1 after a row has been deleted?Okay, so let's say I have a mysql database tabl




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: