How does changing the order parameter from ASC to DESC affect the output of the SQL query in the context of the PHP code provided?

Changing the order parameter from ASC to DESC in an SQL query will reverse the order in which the results are returned. This means that the results will be sorted in descending order instead of ascending order. To implement this change in the provided PHP code, simply update the SQL query to include DESC instead of ASC in the ORDER BY clause.

<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

$conn = new mysqli($servername, $username, $password, $dbname);

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$sql = "SELECT id, name, email FROM users ORDER BY name DESC";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    while($row = $result->fetch_assoc()) {
        echo "ID: " . $row["id"]. " - Name: " . $row["name"]. " - Email: " . $row["email"]. "<br>";
    }
} else {
    echo "0 results";
}

$conn->close();
?>