Quote:
Originally Posted by TTJJ
Hi BaubaS,
When you say by money, I assume you mean you want to determine which player has X amount of money? If so you can use the following:
PHP код:
SELECT `column_name` FROM `table_name` WHERE money = '%d'
"%d" obviously being the amount of money, however if you are looking to see how many people have X amount of money, you would do the following:
PHP код:
SELECT COUNT(id) AS count FROM `table_name` GROUP BY money
Hope it helped.
Cheers,
TJ
EDIT: I think I actually understand a little better, you want to rank the players in order of money. In which case you would use the following:
PHP код:
SELECT name FROM `table_name` ORDER BY money DESC
This query would return a list of players in order of money from highest to lowest, the first result would be the player who currently has the most amount of money.
|
Thanks for trying to help, but you haven't got the point. I want to get certain player (for example - player a) rank for example by money.
Quote:
EDIT: I think I actually understand a little better, you want to rank the players in order of money. In which case you would use the following:
PHP код:
SELECT name FROM `table_name` ORDER BY money DESC
|
This is very same what do I need ,but I need to get certain player rank, not to rank all players.