In this example, we establish a connection to our MySQL database and insert a new record into the "users" table. After the INSERT statement has been executed, we call the mysqli_insert_id() function to retrieve the ID of the newly inserted record. This ID is then printed to the screen using the echo statement. The mysqli_insert_id() function is part of the MySQL Improved Extension, which is included in most PHP installations by default.