get id of last inserted row php code example Example: get last inserted id in php Example (MySQLi Procedural) $last_id = mysqli_insert_id($conn);