while sorgusunu kullanmalısınız bir örnek yaptım deneyin çalışacak mı ona göre yardımcı olabilirim.
$mesajlar = mysql_query("select * from tablo where onay='1' ");
while ($sorgu_mesaj = mysql_fetch_array($mesajlar))
{
echo $sorgu_mesaj[0];
echo $sorgu_mesaj[1];
echo $sorgu_mesaj[2];
}
?>
şuanlık kodum bu : http://pastebin.com/6jzMG6Tq
verdiğin kodu denedim olmadı.