$q = mysql_query("SELECT name FROM stats"); while($r = mysql_fetch_array($q)) { $name = $r['name']; echo $name; }