PHP lists this example as a way to retrieve database data.
<?php
$return = []
$qry = "SELECT * FROM exp_member_data";
$res = mysql_query($mem_qry);
function mysql_fetch_all($res) {
while($row=mysql_fetch_array($res)) {
$return[] = $row;
}
return $return;
}
?>
I am confused about how this while loop progresses. What guarantees that $row=mysql_fetch_array($res) is different for every iteration of the while loop?
From the docs:
So it doesn’t guarantee that it will be different, only that it will retrieve the next row.