I have a table with an id field, set to auto increment.
However, say I insert 10 records, and then empty the table, the first new record will be id number 11.
Why is this, and is there a way to prevent it from happening?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The auto increment isn’t reset automatically following a delete
TRUNCATE TABLE tbl_namewill delete all records and reset the Auto Increment field or you can use
Source