How can multiple database updates be combined into a single query for better performance in PHP?

When multiple database updates need to be performed in PHP, it is more efficient to combine them into a single query for better performance. This can be achieved by using the SQL "UPDATE" statement with multiple "SET" clauses to update multiple rows or columns in a single query.

// Example of combining multiple database updates into a single query
$query = "UPDATE table_name SET column1 = value1, column2 = value2 WHERE condition";
$result = mysqli_query($connection, $query);

// Check if the query was successful
if($result) {
    echo "Multiple updates were successfully executed.";
} else {
    echo "Error executing multiple updates: " . mysqli_error($connection);
}