What is the next incremental identifier for?
MySQL allows only one auto-increment field per table, and it should also be the primary key to ensure uniqueness.
Please note that when you receive the following insert identifier, it may not be available when you use it, since the value you have is only within this transaction. Therefore, depending on the load on your database, this value can be used at the time the next request arrives.
I would advise you to review your design to make sure you don't need to know what auto-increment value the next one assigns.
Stephen Senkomago Musoke Jul 09 '12 at 12:11 2012-07-09 12:11
source share