MySQL - Top 10
#1

How to get the players who has highest score? (load the score from MySQL) like:

10. Unknown123 - 1337 Score
9. Unknown321 - 1287 Score
ect....
1. Unknown1337 - 69 Score

pawn Code:
COMMAND:top10(playerid, params[])
{
    hmm
}
Reply
#2

Code:
SELECT * FROM `playerTable` WHERE `playerScore` > 0 ORDER BY `playerScore` DESC LIMIT 10
would be your query. I won't give you any more code since you haven't given us enough details (what plugin you're using, what fields you have, if you use threads, etc).
Reply
#3

Oh thanks Calg00ne, I wanted to remove the ones with 0 stats from the list! Now I know how.
Reply
#4

Im using Strickenkid's plugin

SELECT * FROM `accounts` WHERE `Score` > 0 ORDER BY `Score` DESC LIMIT 10
Reply
#5

I can't help you if you're using that plugin then.
Reply
#6

Quote:
Originally Posted by anonymousx
View Post
What about G-sTyLeZzZ's MySQL Plugin?
pawn Code:
mysql_query("SELECT * FROM `playerTable` WHERE `playerScore` > 0 ORDER BY `playerScore` DESC LIMIT 10");
mysql_store_result();
//Code here
mysql_free_result();
Reply
#7

Quote:
Originally Posted by Biesmen
View Post
pawn Code:
mysql_query("SELECT * FROM `playerTable` WHERE `playerScore` > 0 ORDER BY `playerScore` DESC LIMIT 10");
mysql_store_result();
//Code here
mysql_free_result();
All you added was store_result and free_result, This don't help at all!
Reply
#8

Please help ^
Reply
#9

Quote:
Originally Posted by Unknown123
View Post
Im using Strickenkid's plugin

SELECT * FROM `accounts` WHERE `Score` > 0 ORDER BY `Score` DESC LIMIT 10
Quary's are always the same, no matter what plugin you use.
Reply
#10

Quote:
Originally Posted by WackoX
View Post
Quary's are always the same, no matter what plugin you use.
I asked what plugin he was using and what fields he wanted, he never said the query might be different nor was it even implied.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)