How can the code snippet be improved to achieve the desired result?

The issue with the current code snippet is that the `echo` statement is outside the `while` loop, so it only prints the last row of the result set. To achieve the desired result of printing all rows, the `echo` statement should be moved inside the `while` loop.

<?php
// Assume $result is the result set from a database query
while($row = mysqli_fetch_assoc($result)) {
    echo $row['column_name'] . "<br>";
}
?>