$hata="Mysql sorgu hatası";
$sorgu=mysql_query("select id.db,deger.ikincidb from db,ikincidb where id.db = second_id.ikincidb") or die($hata);