While loop is over my head
View Single Post
08-31-2009, 03:01 AM
Join Date: Apr 2008
That helps...I'm still trying to get the full hang of this concept.
while($row = mysql_fetch_assoc($result))
1. The variable $row will be assigned the value(s) of the array of the first row of the results of the db query (assuming the query was successful).
2. Do everything within the WHILE loop. Drop the pointer to the second row in the db query results.
3. If there is another row in the db query results, then $row will take the second row's array value and repeat the WHILE loop.
4. And on and on, until the pointer is passed the last row of the db query resultset, at which point $row will not contain a value, and the WHILE loop exits.
Does that sound about right for the WHILE loop statement?
View Public Profile
Send a private message to Dave
Find More Posts by Dave