What are some common issues when displaying database query results in PHP and how can they be resolved?

Issue: Displaying special characters from a database query in PHP can result in garbled or incorrect output. To resolve this, use the `utf8_encode()` function to properly encode the characters before displaying them.

// Fetch data from database
$query = "SELECT * FROM table";
$result = mysqli_query($connection, $query);

// Display data with proper encoding
while($row = mysqli_fetch_assoc($result)) {
    echo utf8_encode($row['column_name']);
}