elmas156 Posted September 7, 2010 Share Posted September 7, 2010 Just a quick question about the behavior of MySQL when a field is set for auto increment... Lets say there are 100 entries with id numbers 1-100. If random entries are deleted from the table, then one is later re-entered with the same id number manually inserted rather than allowing the AI to assign a new number, will the next AI id number always be 101 or would it ever go to the next available number after the manually re-entered id number? I hope I explained that correctly... On a smaller scale, here's an illustration: id 1 2 3 4 5 id 2, 3, and 4 are deleted leaving this: id 1 5 if id 2 is re-inserted manually rather than allowing the auto increment to assign id 6, will the next auto increment id number continue at 6 or will it ever use the next available number, in this case, 3? id 1 2 - inserted manually 5 (3 or 6?) - new auto increment number Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/212794-behavior-of-mysql/ Share on other sites More sharing options...
Maq Posted September 7, 2010 Share Posted September 7, 2010 The next auto-incremented number would be 6. Quote Link to comment https://forums.phpfreaks.com/topic/212794-behavior-of-mysql/#findComment-1108440 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.