I am using MySQL as the database.
I have a table in which the ID Field is the primary key with an auto increment option.
Now whenever a new row is inserted the ID field populates the next number aka MAX+1.
My question is, how do I make the insert statement return me back the ID field value whenever a new row is inserted ?
The insert is just like any normal insert statement and the ID Field gets auto generated since its set to auto increment.
Also it should be taken into consideration that multiple users would be doing the insert and would expect the corresponding ID field to be returned. No mismatch.
Awaiting replies
I have a table in which the ID Field is the primary key with an auto increment option.
Now whenever a new row is inserted the ID field populates the next number aka MAX+1.
My question is, how do I make the insert statement return me back the ID field value whenever a new row is inserted ?
The insert is just like any normal insert statement and the ID Field gets auto generated since its set to auto increment.
Also it should be taken into consideration that multiple users would be doing the insert and would expect the corresponding ID field to be returned. No mismatch.
Awaiting replies