File size: 756B
<?php
$sql = "SELECT a.lastact, a.name, a.id, b.uid, b.tid, b.reqdt FROM mx_users a INNER JOIN mx_buddies b ON (a.id = b.uid) OR (a.id=b.tid) WHERE (b.uid='".$who."' OR b.tid='".$who."') AND b.agreed='1' AND a.id!='".$who."' GROUP BY 1,2 ORDER BY a.lastact DESC LIMIT 5";
$items = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($items)>0)
{
echo "<div class=\"box_cen\" align=\"center\">";
echo"<b>Random Friends</b>";
echo "<div class=\"box_sub\" align=\"center\">";
while ($item = mysql_fetch_array($items))
{
$foto = idle($item[2], 25, 25);
$lnk = "<a href=\"prov.php?show=viewuser&who=$item[2]&hits=$hits\">$foto</a>";
echo "$lnk";
}
echo "</div></div>";
}
?>