I'm making a ranking list based on user earned,
I made the top 10 ranking when it was displayed but i need to show the ranking from the user but he doesn't have the top 10 ranking
example:
rank1: Jhon
rank2: Jhon 2
rank3: Jhon 3
rank4: Jhon 4
rank5: Jhon 5
rank6: Jhon 6
rank7: Jhon 7
rank8: Jhon 8
rank9: Jhon 9
rank10: Jhon 10
rank465: Jhon 465 (based on user login)
I need Jhon 465 and his rank displayed in the ranking list
here the php sql code
i use smarty framework to show myphp
/** PHP SQL CODE **/
$q = $db->query("SELECT user_id,earned," . $query24h . ", " . $query7d . ", " . $query30d . " FROM bonusads_stats ORDER BY " . $orderby . " DESC LIMIT 10");
while ($r = $db->fetch_array($q)) {
$r['username'] = $db->fetchOne("SELECT username FROM members WHERE id=" . $r['user_id']);
$r['country'] = $db->fetchOne("SELECT country FROM members WHERE id=" . $r['user_id']);
$r['type'] = $db->fetchOne("SELECT type FROM members WHERE id=" . $r['user_id']);
$flag = $bacontest_flags[$r['country']];
$r['country'] = strtolower($flag);
$r['type'] = $membership_name[$r['type']];
$top10[] = $r;
$r['earned'] = $db->fetchOne("SELECT earned FROM bonusads_stats");
}
/** SHOW PHP CODE (USE SMARTY) **/
{foreach from=$top10 item=foo key=k}
<tr style="text-align:center">
<td><span class="rc-position">{$k+1}</span></td>
<td>{$foo.type}</td>
<td> <img src="images/forum/flags/{$foo.country}.png" style="margin-right : 8px" title="{$item.member.country}" />{$foo.username}</td>
<td>{$foo.last24hours}</td>
<td>${$foo.earned}</td>
<td>${$foo.earned * 10}</td>
</tr>
{/foreach}
how to display the ranking of users login but he is not in the top 10 ranks