Sbagli il valore che dai alle variabili...
Cambia il codice così:

Codice PHP:
$query mysql_query("SELECT id FROM utenti WHERE id='$id'")or die(mysql_error());
$row mysql_fetch_array($query);
$id $row['id'];
$friendsname mysql_query("SELECT username FROM utenti")or die(mysql_error());
while(
$record mysql_fetch_array($friendsname)){
                 
echo 
"<a href=\"http://localhost:8888/fs/friendsprofile.php?id={$id}\" >'$friendsname '</a>"

Invece di:
Codice PHP:
$id mysql_query("SELECT id FROM utenti WHERE id=$id"); 
                 
$friendsname mysql_query("SELECT username FROM utenti"); 
                 
                  echo 
'[url="http://localhost:8888/fs/friendsprofile.php?id=[$id]"]'$friendsname '[/url]'