I'm trying to pull data out of a MySQL DB and show it on a php page. I would like to show all entries for a particular column, but every example I try either doesn't work, or this one shown below, that only shows 1. I'm thinking maybe I can loop or add another $row, but Im not sure. There could potantialy be a lot of entries, so im guessing it wiould need to loop until the end.
$result = mysql_query("SELECT name FROM s_users WHERE rank = 1 LIMIT 0 , 30") or die(mysql_error());
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$sl = $row['name'];
When that's echo'd it only shows 1 entry, when the db is showing several names that fit the criteria.. Is there also a way to show them in a row with comma seperators? name1, name2, name3...