Sorting Players According to Kills
#6

Quote:
Originally Posted by iggy1
Посмотреть сообщение
What difference will that make?

OP: Get top 5 user kills with names.
pawn Код:
"SELECT username, kills FROM users ORDER BY kills DESC LIMIT 5"
Very easy to add that query to a function that gets the top 'number' anything.

EDIT:

That is a pretty slow query if the database is large, so it's a good idea to create an index on the kills column. Especially if you run this query often.
Hello,
Can you tell me that is i use the code you provided how do i run it?mysql_query?
sorry am a newb in mysql and sqlite.

also can you show me a full working script for example i wanna print the top 5 players name and their kills, what will i do after querying(please provide code if possible)
thanks.
Reply


Messages In This Thread
Sorting Players According to Kills - by [HK]Ryder[AN] - 16.12.2012, 07:07
Re: Sorting Players According to Kills - by RajatPawar - 16.12.2012, 08:21
Re: Sorting Players According to Kills - by RedCrossER - 16.12.2012, 08:28
Re: Sorting Players According to Kills - by iggy1 - 16.12.2012, 09:55
Re: Sorting Players According to Kills - by RajatPawar - 16.12.2012, 10:45
Re: Sorting Players According to Kills - by [HK]Ryder[AN] - 16.12.2012, 11:58
Re: Sorting Players According to Kills - by iggy1 - 16.12.2012, 12:38

Forum Jump:


Users browsing this thread: 1 Guest(s)