select TakasSonuc.*, Kitap.id as kid, Kitap.kitapadi, Kitap.resim as kresim, k1.adsoyad as k1adsoyad, k1.kullaniciadi as k1kadi, k2.adsoyad as k2adsoyad, k2.kullaniciadi as k2kadi, a.id as apid, g.id as gpid, a.resim as apresim , g.resim as gpresim from TakasSonuc inner join Kitap on Kitap.id = TakasSonuc.kitapid inner join (Kullanici as k1 inner join Profil as a on k1.id = a.kullaniciid) on TakasSonuc.alanprofilid = a.id inner join (Kullanici as k2 inner join Profil as g on k2.id = g.kullaniciid) on TakasSonuc.gonderenprofilid = g.id order by id asc