[!--quoteo(post=357040:date=Mar 21 2006, 06:01 PM:name=redarrow)--][div class=\'quotetop\']QUOTE(redarrow @ Mar 21 2006, 06:01 PM)
I have read your post and thank you for your time cheers.
not a problem. honestly, i remember some of the stuff they used to teach me at college...
as for what type of loop to use, i generally have a few rules of thumb when deciding which one to use:
1) 'for' loops - i use these when i know how many times the loop needs to be executed, and i need to keep tabs on the counter
2) while loops - i use these if i need to test a condition or initialise some data BEFORE executing a loop an unspecified amount of times. for example, when i want to pull out a row from the database and display it, but dont initially necessarily know (or care) how many rows i have. this example pulls EVERY result from a database query:
while ($row = mysql_fetch_assoc($db_result))
3) do...while loops - same as 2, but when i want to execute a loop at LEAST once. eg:
$row = mysql_fetch_assoc($db_result);
while ($row = mysql_fetch_assoc($db_result));
hope that'll clear it up.
"you have to keep pissing in the wind to learn how to keep your shoes dry..."
I say old chap, that is rather amusing!