Reputation: 1197
Quick question regarding phpMyAdmin and autoincrementing. If I add a product and it is assigned id 1, then I delete it before adding another, the next one is given the id 2 even though I deleted id 1. I hope this makes sense.
Does this matter?
Upvotes: 0
Views: 146
Reputation: 963
Its not the way it works. The auto increment value is stored in a variable, and it only adds one to that, instead of checking the largest one and adding one to that. Its the normal behavior, it looks messy but it works fine.
Upvotes: 1
Reputation: 4034
Consider the example where you had 1000 rows, and deleted the row ID=1. Would you expect the next entry to be given an ID of 1001 ? or 1 ?
This is working as intended, though if you absolutely must, you can manually set the value just as you would any other column in MySQL.
Upvotes: 0