Sorunu halettim arkadaşlar 2. while sorgusu içinde $sorgu kullandığım için hata oluştu 2. sorgudaki $sorgu yerine $sorgum yaptım halloldu...