What is the best practice for handling multiple query results in PHP?

When handling multiple query results in PHP, it is best practice to use a loop to iterate through each row of the result set and process them individually. This ensures that all results are properly handled and avoids potential issues with memory consumption.

// Assuming $result contains the query result set
while ($row = mysqli_fetch_assoc($result)) {
    // Process each row individually
    echo $row['column_name'] . "<br>";
}