- 1
- 2
- 3
- 4
- 5
- 6
- 7
$friends = mysql_query("(SELECT * FROM `friends` WHERE `from` LIKE '{$act}' AND `to` LIKE '{$act}' AND `isaccepted` = '1') UNION (SELECT `id` , `name` , `surname` FROM `users_info`);");
$friend = array();$loop=0;
while($fetch = mysql_fetch_assoc($friends)) {
if ($fetch['from'] == $act) $search=$fetch['to']; else $search=$fetch['from'];
$friend[$loop]=mysql_fetch_assoc(mysql_query("SELECT `id`,`name`,`surname` FROM `users_info` where `id`='{$search}'"));
$loop++;
}