Hi, You know, this worked just fine, as did my order by. Its my brain that is completely wacked. I am going about this all wrong....
Thanks for all your help.. Take care.. I'll let you know how it goes. -Dan Joseph > -----Original Message----- > From: Marek Kilimajer [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 22, 2003 11:25 AM > To: Dan Joseph > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Array Sorting, 2 items... > > > Your array seems like a result of mysql_fetch_array(), cannot you order > it in the sql query? > > Dan Joseph wrote: > > Array > > ( > > [0] => Array > > ( > > [0] => CHECKING > > [ba_type] => CHECKING > > [1] => 10132200 > > [loan_number] => 10132200 > > > Keep everything groupped together in their respective > ba_type, and put the > > numbers in numeric order. I've looked at usort, and many > examples of it. I > > can see how to use it to sort one column, but how would I sort > a second to > > achieve this? > Simply if ba_types are equal, continue with checking loan_numbers: > > function cmp ($a, $b) { > if ($a['ba_type'] == $b['ba_type']) { > if ($a['loan_number'] == $b['loan_number']) return 0; > return ($a['loan_number'] > $b['loan_number']) ? -1 : 1; > } > return ($a['ba_type'] > $b['ba_type']) ? -1 : 1; > } > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php