[PHP] Re: Sorting multidim array and keeping associations

2004-12-11 Thread Peter Lauri
Stupid as I was, I did not do what I should have done :) In the origin the array was created from a MySQL database. I did not sort it correctly from there because I did not have the knowledge about the GROUP BY command, so I tried to solve it via PHP. Now I have everything sorted and alright just b

[PHP] Re: Sorting multidim array and keeping associations

2004-11-18 Thread Sebastian Mendel
Peter Lauri wrote: The problem was more complex than I described, I instead wrote a sorting algorithm for this specific purpose. The array multi-dim array looks like this (short version). The total element is just the sum of the other. This is a point system for golftournaments. I wanted to sort th

[PHP] Re: Sorting multidim array and keeping associations

2004-11-18 Thread Peter Lauri
The problem was more complex than I described, I instead wrote a sorting algorithm for this specific purpose. The array multi-dim array looks like this (short version). The total element is just the sum of the other. This is a point system for golftournaments. I wanted to sort them first on "total

[PHP] Re: Sorting multidim array and keeping associations

2004-11-18 Thread Sebastian Mendel
Peter Lauri wrote: I have an multidim array that looks something like this: [40] => [1]=32, [2]=>55, ["total"]=>87 [22] => [8]=2, [7]=>105, ["total"]=>107 [142] => [2]=3, [7]=>8, ["total"]=>11 I want to sort this array according to the "total" and still keep the acc. with the basekey. I know I can

[PHP] Re: Sorting multidim array and keeping associations

2004-11-17 Thread Peter Lauri
I have tried to figure it out how to use it with those, but I can not find a solution. - Best Of Times /Peter "Sebastian Mendel" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > Peter Lauri wrote: > > Best groupmember, > > > > I have an multidim array that looks something like th

[PHP] Re: Sorting multidim array and keeping associations

2004-11-17 Thread Peter Lauri
I have tried to figure it out how to use it with those, but I can not find a solution. - Best Of Times /Peter "Sebastian Mendel" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > Peter Lauri wrote: > > Best groupmember, > > > > I have an multidim array that looks something like th

[PHP] Re: Sorting multidim array and keeping associations

2004-11-17 Thread Sebastian Mendel
Peter Lauri wrote: Best groupmember, I have an multidim array that looks something like this: [40] => [1]=32, [2]=>55, ["total"]=>87 [22] => [8]=2, [7]=>105, ["total"]=>107 [142] => [2]=3, [7]=>8, ["total"]=>11 I want to sort this array according to the "total" and still keep the acc. with the base