Jump to content
MakeWebGames

Recommended Posts

Posted

well av got on my login page the top 5 and its not showing them in the order wen some new comes in the game it knocks the other players out the top 5 how do i go about this so the other players stay on the list in till some 1 takes over them like if a was lvl 10 they wld need to get to lvl 11 to tale over me on the front page and in the orders from 1 to 5 top to bottom ? thanks any help on this wld be great :rolleyes:

Posted

$player = $db->fetch_row($db->query('select userid, username, level from users order by level desc limit 5'));

That'll select USERID, USERNAME, AND USERS LEVEL from the users table, then order the results by level DESCENDING, then limits to 5 results.

Output would be ".$player['userid']."

Posted

expanding on jordan's a bit:

 

$r = $db->query("SELECT `userid`, `username`, `level` FROM `users`ORDER BY  level DESC LIMIT 5");

while ($ir = $db->fetch_row($r) )
{
echo ' '.$ir['username'] .' '.$ir['level'].' 
';
}

 

That will print out all 5 of your top users

Posted
expanding on jordan's a bit:

 

$r = $db->query("SELECT `userid`, `username`, `level` FROM `users`ORDER BY  level DESC LIMIT 5");

while ($ir = $db->fetch_row($r) )
{
echo ' '.$ir['username'] .' '.$ir['level'].' 
';
}

 

That will print out all 5 of your top users

thanks i had one but was show wrong ? 8o 8o 8o
Posted

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/********/public_html/login.php on line 243 dont under stand y this is going like this av tryin just about everyfing i no :S lol

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...