After you perform an INSERT operation, you can retrieve the ID of the last row inserted with the following command: SELECT LAST_INSERT_ID();