The mysqli_insert_id() function returns the id (generated with AUTO_INCREMENT) used in the last query.
mysqli_insert_id(connection);
Assume that the Persons table has an auto-generated id field. Return the id used in the last query:
Parameter | Description |
---|---|
connection | Required. Specifies the MySQL connection to use |