GreenFanta Posted January 16, 2011 Share Posted January 16, 2011 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 Quote Link to comment Share on other sites More sharing options...
dragon_sa Posted January 16, 2011 Share Posted January 16, 2011 $sql = "SELECT * FROM `clans` WHERE `available` =1 LIMIT 0 , 30"; $result = mysql_query($sql); if (mysql_num_rows($result)!=0) { while ($row = mysql_fetch_assoc($result)) { echo ($row['name']); } } Quote Link to comment Share on other sites More sharing options...
GreenFanta Posted January 16, 2011 Author Share Posted January 16, 2011 Thank you for your fast response, it works, thanks again! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.