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