SQL

MySQL LAST_INSERT_ID() Function

Return the AUTO_INCREMENT id of the last row that has been inserted or updated in a table: