i would create an array or do a while loop instead using
something like
PHP Code:
$currentid = $vbulletin->userinfo['userid'];
$myfriends = "";
$Buddylist=("SELECT * FROM ".TABLE_PREFIX." WHERE userid='".$currentid."'");
while($row=$vbulletin->db->fetch_array($Buddylist))
{
$myfriends .= $row['relationid'] .',';
}
and output would be of $myfriends something like
1,2,24,2,434,2, etc..
then i could always explode the contents if i needed them seperatly..
But you could also pull the individual user info of all the friends inside the loop,
after you got the $myfriends simple create another while loop inside
and fetch content from each user there, and store im in $myfriends[] array.