I don't understand why this code works:
while ($row = mysqli_fetch_object($result)){
echo $row->id . " ";
echo $row->first_name . " ";
echo $row->last_name . "<br>";
}
This is a part of a tutorial on CRUD that I am learning. The while loop goes through the whole table and lists all the rows and columns. But from my understanding of while-loops, this shouldn't work.
My guess would be that it should try to print out the current row infinite times and crash my browser as there is no change in the condition. Why does it go through all the rows? Why does it stop? I can't find answer to this anywhere.
Would there be anyone kind enough to explain in simple terms?