What are the differences between using mysqli_query in PHP 5.x and PHP 7.2?

In PHP 5.x, the mysqli_query function requires two parameters: the database connection and the query string. However, in PHP 7.2, the order of parameters has been reversed, and the query string is now the first parameter followed by the database connection. Here is an example of how to use mysqli_query in PHP 7.2:

// Create a database connection
$conn = mysqli_connect("localhost", "username", "password", "database");

// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}

// Query the database
$query = "SELECT * FROM table";
$result = mysqli_query($conn, $query);

// Check if query was successful
if ($result) {
    // Process the query result
} else {
    echo "Error: " . mysqli_error($conn);
}

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