I'm trying to show results from my database, I did not know how until I saw this way of doing while($row=mysql_fetch_array($result) { //Code }
and then I saw that using this form is somewhat obsolete, so I would have to choose to use while($row = $query->fetch(PDO::FETCH_ASSOC)) { //Code }
.
My problem is, I do not understand how the while works: At what moment does it stop being true? What are the data that iterates? In a few words How does this code work?