Jump to content

Setting each fetch_array to vars?


Rifts

Recommended Posts

Hello!

 

I'm pretty new to php/mysql so I hope my question makes sense

 

I have this code:

$sql = mysql_query("select * from members ORDER BY 'score' ");

echo "<table border='1'>";
echo "<tr> <th>Name</th> <th>Score</th> </tr>";
while($row = mysql_fetch_array( $sql )) {
echo "<tr><td>"; 
$asd = $row['name'];
echo $row['FacebookID'];
echo "</td><td>"; 
echo $row['score'];
echo "</td></tr>"; 
} 

echo "</table>";

 

and it works just fine it prints out the 3 people in the data base with their score

 

my question is this; is there anyway to set each of the three peoples name to different vars after they are printed?

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/195249-setting-each-fetch_array-to-vars/
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.