Value for auto number primary key | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Value for auto number primary key

It's there an easy way to get the number of the auto generated id when I insert a new entry?

7th Oct 2016, 8:13 PM
Andrew Dunk
Andrew Dunk - avatar
1 Answer
+ 4
I found the answer out! If you are using MySQL you get the auto increment ID of the last insert with: SELECT LAST_INSERT_ID();
9th Oct 2016, 9:56 AM
Andrew Dunk
Andrew Dunk - avatar