In PHP, it is possible to execute multiple queries using the mysqli_multi_query() function. This function allows you to send multiple SQL statements to the database server in a single call.

Here is an example of how to use mysqli_multi_query() in PHP:

// Connect to the database
$conn = mysqli_connect(“localhost”, “username”, “password”, “database”);

// Define the SQL statements to be executed
$sql = “SELECT * FROM users; “;
$sql .= “SELECT * FROM orders; “;

// Execute the SQL statements
if (mysqli_multi_query($conn, $sql)) {
do {
// Get the result set
if ($result = mysqli_store_result($conn)) {
// Process the result set
while ($row = mysqli_fetch_assoc($result)) {
// Do something with the data
}
mysqli_free_result($result);
}
} while (mysqli_more_results($conn) && mysqli_next_result($conn));
}

// Close the database connection
mysqli_close($conn);

In this example, we first connect to the database using mysqli_connect(). Then, we define two SQL statements, separated by a semicolon, which we want to execute using mysqli_multi_query(). We then check if the queries were executed successfully, and if so, we loop through each result set and process the data using mysqli_store_result(), mysqli_fetch_assoc(), and mysqli_free_result(). Finally, we close the database connection using mysqli_close().

Note that it is important to use mysqli_next_result() to move to the next result set after processing each result set. Also, be aware that executing multiple queries in a single call can be risky, as it can make your application vulnerable to SQL injection attacks. Be sure to sanitize any user input and use prepared statements whenever possible to mitigate this risk.