query
#7

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_nameFROM `table_nameWHERE 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_nameGROUP 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_nameORDER 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.
Reply


Messages In This Thread
rank - by BaubaS - 12.03.2012, 13:02
Re: query - by BaubaS - 12.03.2012, 18:26
Re: query - by Vince - 12.03.2012, 18:41
Re: query - by MP2 - 12.03.2012, 19:19
Re: query - by BaubaS - 12.03.2012, 19:53
Re: query - by BaubaS - 13.03.2012, 10:43
Re: query - by TTJJ - 13.03.2012, 10:49
Re: query - by BaubaS - 13.03.2012, 10:55
Re: query - by TTJJ - 13.03.2012, 11:24
Re: query - by BaubaS - 13.03.2012, 12:16

Forum Jump:


Users browsing this thread: 1 Guest(s)