xxxxxxxxxx
// Assuming you have established a database connection using mysqli
// Perform the insert query
$insertQuery = "INSERT INTO table_name (column1, column2) VALUES ('value1', 'value2')";
mysqli_query($conn, $insertQuery);
// Retrieve the ID of the last inserted row
$lastInsertId = mysqli_insert_id($conn);
// Output the last inserted ID
echo "The last inserted ID is: " . $lastInsertId;