grant Posted November 28, 2010 Posted November 28, 2010 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: Quote
Danny696 Posted November 28, 2010 Posted November 28, 2010 Let me point you too; http://makewebgames.io/board290/34204-english Quote
grant Posted November 28, 2010 Author Posted November 28, 2010 Let me point you too; http://makewebgames.io/board290/34204-english in how is that going to help ? in any way ;( Quote
Jordan Palmer Posted November 28, 2010 Posted November 28, 2010 $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']." Quote
Rasheed saeed Posted November 28, 2010 Posted November 28, 2010 @Danny: Any need? Isn't really helping the reputation of MWG being 'helpful'.. Quote
SilvaTungDevil Posted November 28, 2010 Posted November 28, 2010 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 Quote
Danny696 Posted November 28, 2010 Posted November 28, 2010 echo ' '.$ir['username'] .' '.$ir['level'].' '; OR echo $ir['username'] .' '. $ir['level'].' '; Quote
grant Posted November 28, 2010 Author Posted November 28, 2010 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 Quote
Rasheed saeed Posted November 28, 2010 Posted November 28, 2010 Just wondering, what have you select the user's ID if your not using it? :/ Quote
SilvaTungDevil Posted November 29, 2010 Posted November 29, 2010 Thats a very good point rasheed, I only selected it because i used jordans piece. However should he wish to make all the names links to the profiles, then the userid would come in handy other than that it should be removed Quote
Danny696 Posted November 29, 2010 Posted November 29, 2010 If its on the login why would he make it link, they would just go back to the login :) Quote
Jordan Palmer Posted November 29, 2010 Posted November 29, 2010 I select userids because most output the userid. no biggie Quote
grant Posted November 30, 2010 Author Posted November 30, 2010 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 Quote
The Monk Posted November 30, 2010 Posted November 30, 2010 Post your login.php, that way we can see what is on line 243 and help you fix it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.