jaymc Posted September 27, 2006 Share Posted September 27, 2006 I have my ID field set up as auto incrementNow, lets say I have the following in a database in the ID field1234If I delete record 4, that means I will be left with123However, and here is my problem. When a new record is added, it auto increments the ID field to 5. Obviously their is some kind of counter which still holds 4 as the last number.Is their anyway around this without querying the database? Quote Link to comment Share on other sites More sharing options...
fenway Posted September 27, 2006 Share Posted September 27, 2006 Any way around what? What are you using this field for that it matters? Quote Link to comment Share on other sites More sharing options...
jaymc Posted September 27, 2006 Author Share Posted September 27, 2006 Song ID's.In other words, I want it to auto increment from the last ID in the table Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 27, 2006 Share Posted September 27, 2006 Treat auto-incrementing fields as if they belong to MySQL (which they do) and you can't mess with them, instead of something that's yours. You'll be glad you did when you want to use ids from different tables to do some cross-referencing. Quote Link to comment 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.