$veri = mysql_query("select from tablo");
while ($sorgu=mysql_fetch_array($veri)) {
echo ",".$sorgu[alan];
}