What are some best practices for styling and formatting database query results in PHP to improve user experience?

When displaying database query results in PHP, it is important to style and format the data in a visually appealing way to improve the user experience. One best practice is to use HTML and CSS to create a clean and organized layout for the results. You can also consider using tables, lists, or cards to present the data in a structured manner.

<?php
// Assuming $results is an array of database query results

echo '<div class="results-container">';
foreach ($results as $result) {
    echo '<div class="result-item">';
    echo '<h3>' . $result['title'] . '</h3>';
    echo '<p>' . $result['description'] . '</p>';
    echo '</div>';
}
echo '</div>';
?>