Code:
$referrers = DB_site->query("SELECT username,userid FROM user WHERE referrerid='X'");
echo("$bbuserinfo[username] has referred these users: ");
while ($referrer = mysql_fetch_array($referrers)) {
++$i
echo("<a href=\"member.php?s=$session[sessionhash]&action=getinfo&userid=$referrers[userid]\">$referrers[username]</a>");
if ($i < mysql_num_rows($referrers)) {
echo(", ");
}
}
echo(".");