Blasteh
Lord Farquaad
So basically, I'm trying to exclude ranks from being shown in a top stats chart. Yes, I'm talking Habbo, but this is PHP I'm trying to get assistance with.
So right now, it's selecting all users – but I want it to select "rank < 2" so it's only people less than rank 2 that are being shown.
As you can see, there is two tables being selected at once, which makes it a little harder due to the fact it selects the users ID from user_stats.
So right now, it's selecting all users – but I want it to select "rank < 2" so it's only people less than rank 2 that are being shown.
As you can see, there is two tables being selected at once, which makes it a little harder due to the fact it selects the users ID from user_stats.
Code:
<?php
$numberRespect = 0;
$getRespect = mysql_query("SELECT `respect`,`id` FROM `user_stats` ORDER BY respect desc");
while($respectStats2 = mysql_fetch_array($getRespect)) {
$respectq = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $respectStats2['id'] . "'");
$respectStats = mysql_fetch_assoc($respectq);
if ($numberRespect > 4)
continue;
if ($respectStats['rank'] > 100)
continue;
$numberRespect++;
echo '
<tr>
<table width="100%">
<td width="25%"><img src="https://avatar-retro.com/habbo-imaging/avatarimage?hb=img&figure=' . $respectStats['look'] . '&size=m&direction=2&head_direction=2&gesture=sml&headonly=1&size=m" align="left"></td>
<td width="75%"><a href="{url}/home/'.$respectStats['username'].'"><b>'.$respectStats['username'].'</b></a><br />'.$respectStats2['respect'].' Recevied</td></table><hr>
</tr>';
}
?>