mysql ile halledilebilir
SELECT mesajlar.*,kullanicilar.kullanici_adi FROM mesajlar INNER JOIN kullanicilar ON mesajlar.kullanici_id = kullanicilar.id WHERE mesajlar.id = GELENID
Bu mantıkla birden fazla tablodaki veriyi select ile secip inner join ile birleştirebilirsin .
Ornek bir ürün gösterme sorgusu
SELECT urun.*,motor.model,tipler.type FROM urun INNER JOIN motor ON urun.motor_id = motor.id INNER JOIN tipler ON urun.type_id = tipler.id ORDER BY urun.kva ASC
Yukarıdaki ornekte
-urun tablosundaki butun alanlar seciliyor
-motor tablosusundan gosterilmek istenen model seciliyor
-tipler tablosundan goruntulenmek istenen tip seciliyor
-urun tablosundaki motor id = motorlar tablosunda id ile birlestiriliyor
-ayni sekilde ıkinci inner join ile urun tablosundaki urun type_id ile tipler tablosundaki id birlestirilior ve urun tablosundaki kva degerine gore sort ediliyor.
daha sonrasinda $row = mysql_fetch_assoc la tek bir kayit alip print_r($row)
diyerek bir kontrol ettir ciktiyi gor ona gore ekrana bas hocam.