Please anytime i want to display my members photo like 2 or 3 it always giving me more that what i wanted. Eg. I want to display 3 userz photo in random, it will display more than 50 images. Pls whats wrong.
PHP Code:
<?php
$usera=$db->get_row("SELECT * FROM b_users ORDER BY rand() DESC LIMIT 0,3");
if($usera)
{
foreach($usera as $userd8)
{
if (!empty($userd8->avatar))
print "<tr><td><div class=\"advert\"><img src=\"".$config->url."/avatars/".$userd8->avatar."\"
width=\"70\" height=\"70\"> ";
//else, print gravatar
else if($userd8->sex == "female") echo "<img src=\"".$config->url."/avatars/avatarf.png\" width=\"70\" height=\"70\"></img>"; else echo "<img src=\"".$config->url."/avatars/avatarm.png\" width=\"70\" height=\"70\"></img>";
}
}
?>
Comment