Hello,
i have a table, "test" with the following columns
id int auto_increment not null primary key,
name varchar(25) not null unique.
i executed the following statements twice.
insert into test(name) values ('ABCD'); /*executed twice*/
as expected the first run was successful and the second run failed due to unique constraint.
i inserted another record in the table and did a SELECT and i see that the id value is now 3.
i would like to know how id value get incremented to 3. As per my understanding, auto increment value will be generated when the record is inserted into the table. am i missing something here?
-Baburaj