How to Show top10 users? pls. help me.

Started on the old forum in June 2011 · view the original in the archive · old links redirect here

4 replies · 426 views · started 15 years ago · 1 min read

4 participants
pkmob Junior · 31 posts #1

Hey masters, pls. anyone help.

i want to Show,

TOP 10 users ORDER by Points.

pls. give me full Code.

morency Senior · 488 posts #2
select * from USERS where POINTS>1 order by POINTS desc limit 0,10

Unamos los corazones,hoy todos somos multicolores!

pkmob Junior · 31 posts #3

morency wrote:

select * from USERS where POINTS>1 order by POINTS desc limit 0,10

bro. after that code No any More code?

like,

<?php print "$user"; ?>

<php print "$points";?>

khan Lead · 681 posts #4

pkmob wrote: Hey masters, pls. anyone help.

i want to Show,

TOP 10 users ORDER by Points.

pls. give me full Code.

		$q = @mysql_query("select * from `USERTABLE` order by points desc LIMIT 0, 10;");
		while ($data = @mysql_fetch_array($q))
		{
$did = $data['id']; 
$user = $data['username']; 
$point = $data['point'];
echo "$did - $user - $point<br />";
		}
ozziemale31 Lead · 861 posts #5
else if($action=="toponline")

{

    addonline(getuid_sid($sid),"Top Online Users","lists.php?action=$action");

    getshouts($sid);

boxstart("Top Onliners");

   //////ALL LISTS SCRIPT <<

    if($page=="" || $page<=0)$page=1;

    $num_items = regmemcount(); //changable

    $items_per_page= 10;

    $num_pages = ceil($num_items/$items_per_page);

    if(($page>$num_pages)&&$page!=1)$page= $num_pages;

    $limit_start = ($page-1)*$items_per_page;

    //changable sql

        $sql = "SELECT id, name, tottimeonl, sex FROM ibwf_users ORDER BY tottimeonl DESC LIMIT $limit_start, $items_per_page";

    echo "<p>";

    $items = mysql_query($sql);

    echo mysql_error();

    if(mysql_num_rows($items)>0)

    {

    while ($item = mysql_fetch_array($items))

    {

        if($item[3]=='M'){

        $atxt="<img src=\"images/male.gif\" alt=\"M\"/>";

    }

    else if($item[3]=='F'){

        $atxt="<img src=\"images/female.gif\" alt=\"F\"/>";

    }

      $lnk = "$atxt<a href=\"index.php?action=viewuser&who=$item[0]&sid=$sid\">$item[1]</a> Online Time: $item[2] seconds = ".gettimemsg($item[2])."";

      echo "$lnk<br/>";

    }

    }

    echo "</p>";

    echo "<p align=\"center\">";

    if($page>1)

    {

      $ppage = $page-1;

      echo "<a href=\"lists.php?action=$action&page=$ppage&sid=$sid&view=$view\">«PREV</a> ";

    }

    if($page<$num_pages)

    {

      $npage = $page+1;

      echo "<a href=\"lists.php?action=$action&page=$npage&sid=$sid&view=$view\">Next»</a>";

    }

    echo "<br/>$page/$num_pages<br/>";

    if($num_pages>2)

    {

      $rets = "Jump to page<form action=\"lists.php\" method=\"get\"><input id=\"inputText\" name=\"page\" format=\"*N\" size=\"3\"/>";

         $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";

        $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";

        $rets .= "<input id=\"inputButton\" type=\"submit\" value=\"Go\"/></form>";

    echo $rets;

    }

    echo "</p>";

  ////// UNTILL HERE >>

    echo "<p align=\"center\">";

    echo "<a href=\"index.php?action=stats&sid=$sid\">";

echo "Site Stats</a><br/>";

  echo "</p>";

}

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer.. Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free ***

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close