Jump to content

Displaying more than one found result in a query


GreenFanta

Recommended Posts

Hello!

 

I am busy developing a script that returns all users that have the cell "Available" set to 1

but I am unsure how to do this, I am familiar with basic SQL and I have made this:

$sql = "SELECT * FROM `clans` WHERE `available` =1 LIMIT 0 , 30";
if ($result = mysql_query($sql)) {
if (mysql_num_rows($result)) { 
$row = mysql_fetch_assoc($result);
echo ($row['name']);

but it only displays information from the first row found, and I want it to display all the rows found, how can I do this?

Thanks

 

- GreenFanta

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.