What is the significance of using "AS" in a SQL query when working with PHP?

When working with SQL queries in PHP, using "AS" allows you to assign an alias to a column or table, making the query more readable and easier to work with. This can be particularly useful when dealing with complex queries or when joining multiple tables. Example PHP code snippet:

$query = "SELECT users.id AS user_id, users.name AS user_name, orders.total AS order_total
          FROM users
          JOIN orders ON users.id = orders.user_id";
$result = mysqli_query($connection, $query);

// Fetch and display results
while ($row = mysqli_fetch_assoc($result)) {
    echo "User ID: " . $row['user_id'] . ", User Name: " . $row['user_name'] . ", Order Total: " . $row['order_total'] . "<br>";
}