Thread: Sorting
View Single Post
  #3  
Old 11-20-2009, 06:24 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
I know you can do something like

PHP Code:
temp.array = {"foo""bar""meow"};
array[
0].test 10;
array[
1].test 20;
array[
2].test 1;

temp.sortedArray = array.sortByValue("test""float"true); // last parameter is ascending/descending, others should be obvious
echo(sortedArray);
// echos "meow, foo, bar" 
If you're looking for long-term (or even short-term) storage of the data, you should look into SQLite usage. It's a lot easier and more efficient than any way to sort with GS2; it would be as simple as
Quote:
SELECT account, kills FROM kills ORDER BY kills DESC
You can also limit the amount returned without any GS2
Quote:
SELECT account, kills FROM kills ORDER BY kills DESC LIMIT 5
__________________
Reply With Quote