Grazie per la risposta!!!
allora ho messo la tua query in questo modo:
Codice PHP:
$query_limit = mysql_query("SELECT u.username FROM utenti as u
INNER JOIN (SELECT DISTINCT if(from_friend=$id_utente,to_friend,from_friend) as amici
FROM amicizie
WHERE (from_friend=$id_utente or to_friend=$id_utente) and request_status=1 and friend_blocker=1) AS tab ON u.id = tab.amici
ORDER BY u.username");
while($results = mysql_fetch_array($query_limit))
{ // apro parentesi del while iniziale che mi estrae tutti i messaggi ricevuti
$id_amicizia=$results['id_amicizia'];
$from_friend=$results['from_friend'];
$to_friend=$results['to_friend'];
$request_date=$results['request_date'];
$request_status=$results['request_status'];
Solo che non so se la seconda parte dove estraggo i risultati è giusto perchè mi da i seguenti errori:
Notice: Undefined index: id_amicizia in ...
Notice: Undefined index: from_friend in ...
Notice: Undefined index: to_friend in ...
Notice: Undefined index: request_date in ...
Notice: Undefined index: request_status in ...