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