MySQL SET LAST_INSERT_ID

SET @last_id = LAST_INSERT_ID();
Attractive Alligator