Jump to content

How to loop through database results???


voxanBoxer

Recommended Posts

In ASP I would do this:

Do Until db.EOF
  'some code here - db("name"), db("email")
db.MoveNext
Loop

I am able to loop in PHP but not advance the database position:
 
  if ($result){
  $num_rows = mysql_num_rows($result);
        $row = mysql_fetch_array($result);

  for($x=0;$x<$num_rows;$x++){
    // some code here - $row['name'], $row['email']
  }
  }
Link to comment
https://forums.phpfreaks.com/topic/34465-how-to-loop-through-database-results/
Share on other sites

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.