Foreign key relationships may occasionally need to be inserted at the same time as the primary key. We won’t know what the primary key will
Tag: Last Insert ID in MySQL
Last Insert ID in MySQL
LAST_INSERT_ID() function return the AUTO_INCREMENT id of the last row that has been inserted or updated in a table. Here is an example. DROP TABLE