[PHP] sorting multi-dimensional array part 2

2003-02-20 Thread Steve Buehler
The following "Seems" to work. But does anybody know how reliable this might be? Baically, I have a multi-dimensional array and want to sort by one column first, than another than another. Right now, I am using a temporary table in MySQL, but want to speed things up if possible. The command

RE: [PHP] sorting multi-dimensional array

2003-02-20 Thread Steve Buehler
This would work (and might still if I changed things), but the part that calls it is in another function also. Steve At 02:35 PM 2/20/2003 +, you wrote: > -Original Message- > From: Steve Buehler [mailto:[EMAIL PROTECTED]] > Sent: 20 February 2003 05:25 > > Ahhhfinally did it wit

RE: [PHP] sorting multi-dimensional array

2003-02-20 Thread Ford, Mike [LSS]
> -Original Message- > From: Steve Buehler [mailto:[EMAIL PROTECTED]] > Sent: 20 February 2003 05:25 > > Ahhhfinally did it with usort. Thanks to those who gave me that > answer. Now here is a question for that. I would like to > re-use my "cmp" > function without having to rewri

Re: [PHP] sorting multi-dimensional array

2003-02-19 Thread Steve Buehler
Ahhhfinally did it with usort. Thanks to those who gave me that answer. Now here is a question for that. I would like to re-use my "cmp" function without having to rewrite it each time. Can it be written so that instead of "divname" being hard coded, that I can pass the sort field in th

Re: [PHP] sorting multi-dimensional array

2003-02-13 Thread Jonathan Pitcher
Steve, Have you tired Usort ?? http://www.php.net/manual/en/function.usort.php On Thursday, February 13, 2003, at 01:08 PM, Steve Buehler wrote: PHP version 4.2.2 I sure hope that I can get somebody to help me figure this one out. I have a multi-dimensional array that I need to sort. Here

[PHP] sorting multi-dimensional array

2003-02-13 Thread Steve Buehler
PHP version 4.2.2 I sure hope that I can get somebody to help me figure this one out. I have a multi-dimensional array that I need to sort. Here is the code that I have so far: function gettourndivs(){ GLOBAL $sea_id,$PHP_SELF; $result=get_mysql_query("SELECT * FROM `games` WHERE sea_id = '$se

RE: [PHP] sorting multi-dimensional array where array elements are structs [simple class]

2003-02-12 Thread Erin Fry
o. Thanks again. -Original Message- From: Michael Sims [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 11, 2003 7:19 PM To: [EMAIL PROTECTED] Cc: Erin Fry Subject: Re: [PHP] sorting multi-dimensional array where array elements are structs [simple class] On Tue, 11 Feb 2003 08:27:57

Re: [PHP] sorting multi-dimensional array where array elements are structs [simple class]

2003-02-11 Thread Michael Sims
On Tue, 11 Feb 2003 08:27:57 -0600, you wrote: >Thanks for the reply. I had already tried usort previously. For some > reason, there is no data for the array fields at all in the cmp function > - not sure why. Does anyone know? All help is appreciated! Thanks. Can you post a short code sampl

RE: [PHP] sorting multi-dimensional array where array elements are structs [simple class]

2003-02-11 Thread Erin Fry
On Mon, 10 Feb 2003 16:23:10 -0600, you wrote: >Hi. > >I’m working with a multidimensional array where the data in the >array is a class (struct). All the information is being stored correctly, >but I need to sort each “column” (AA0, BA0, etc. – see below) >by the fieldNo portion of the stru

Re: [PHP] sorting multi-dimensional array where array elements are structs [simple class]

2003-02-10 Thread Michael Sims
On Mon, 10 Feb 2003 16:23:10 -0600, you wrote: >Hi. > >I’m working with a multidimensional array where the data in the >array is a class (struct). All the information is being stored correctly, >but I need to sort each “column” (AA0, BA0, etc. – see below) >by the fieldNo portion of the struc

[PHP] sorting multi-dimensional array where array elements are structs [simple class]

2003-02-10 Thread Erin Fry
Hi. I’m working with a multidimensional array where the data in the array is a class (struct). All the information is being stored correctly, but I need to sort each “column” (AA0, BA0, etc. – see below) by the fieldNo portion of the struct. class fieldClass { var $fieldNo; var $srcL