How does PHP handle the iteration of mysqli_result objects in PHP versions 5.4 and above?

In PHP versions 5.4 and above, mysqli_result objects can be iterated using the mysqli_fetch_assoc() function to fetch rows as associative arrays. This function fetches a single row at a time and returns false when there are no more rows to fetch. To iterate over all rows, you can use a while loop that continues fetching rows until false is returned.

// Assuming $result is a mysqli_result object
while ($row = mysqli_fetch_assoc($result)) {
    // Process each row here
    echo $row['column_name'] . '<br>';
}