I use PhpMyAdmin to design database, And I have problem that sometimes I only try to insert some values then I delete it.But when I continue to insert new value, there is continueing id (id is autoincrement, example the last id : 25, but I deleted 25th value, I insert a new value and it is 26th value, not 25th however database are 25 values. I want that new value was inserted, is 25th value ).
How can I do to refresh database???
new value in database
Moderator: General Moderators
users should not have access to the auto_increment value... and auto_increment value should have no really association with whatever it's used to identify. All it does is create a unique id for each record... there is absolutely NO reason why it should EVER have to be in perfect order. as long as it increments every time...
So I have one questionThe Ninja Space Goat wrote:users should not have access to the auto_increment value... and auto_increment value should have no really association with whatever it's used to identify. All it does is create a unique id for each record... there is absolutely NO reason why it should EVER have to be in perfect order. as long as it increments every time...
What will be id when deleting in database?New id is continue or have same value (I have shown a example).
Because I don't have experience with database. This is the first time I have worked in database.
As others have said, the purpose of an auto-increment field is to insure that there are no duplicate identifiers in a table. Users (and even administrators) should never be concerned about WHAT value it contains, only that it is unique. If that's not what you wanted, you should not have used an auto-increment field. Databases are not just glorified spreadsheets, they are based on strict mathematical set theory. If you are going to continue working with databases, I strongly recommend that you take a course in database theory.