Jump to content

Explaination of While Loop Using mysql_fetch_array()


andykupe

Recommended Posts


<?php
while($row = mysql_fetch_array($result)){
echo $row['name']. " - ". $row['age'];
}
?>

 

For the above code, how come there is no incrementer? Since I am assuming the loop goes down each row after an iteration, how can you get more control over the loop? For example, how could I print every other row?

 

Thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.