How can database query results be displayed as links in a while loop?

When displaying database query results as links in a while loop, you can concatenate the query result with HTML anchor tags to create clickable links. This can be achieved by echoing out the query result within the anchor tag href attribute.

<?php
// Assuming $result is the variable containing the query results
while($row = mysqli_fetch_assoc($result)) {
    echo '<a href="' . $row['link'] . '">' . $row['title'] . '</a><br>';
}
?>