PHP mysqli_insert_id() function returns the auto-generated id used in the last query.
Syntax
Parameter | Description |
---|---|
Connection : | Required parameter. The MySQL connection to be used |
Return Values : | Returns the value of the AUTO_INCREMENT field that was updated by the previous query. |