$query = $db->query(sprintf("SELECT * FROM `users` U,`friends` F WHERE `F`.`idu` = `U`.`idu`", $db->real_escape_string($hemin_userin_id)));
while($row = $query->fetch_assoc()){
echo $row['dostun_adi_sutunu'] . '<br/>';
}
//Burada users userler tablosu friends dostlar tablosu idu - her iki...