Re: [PHP-DB] Sorting a PHP array

2013-05-18 Thread Richard Quadling
I have an inline result set sorting function (array_multisort_by_columns() sort of thing) as array_multisort wants the data in columns for sorting. I can supply it if anyone wants it. On 16 May 2013 12:57, Jim Giner wrote: > On 5/15/2013 1:38 PM, Bastien wrote: > >> >> >> Bastien Koert >> >> O

Re: [PHP-DB] Sorting a PHP array

2013-05-16 Thread Jim Giner
On 5/15/2013 1:38 PM, Bastien wrote: Bastien Koert On 2013-05-15, at 12:32 PM, "Charlie Lewis" wrote: I have a bookseller database list read into a PHP array with dimensions [row][field]. There are 32 fields in each record/row and up to 500 records. What is the neatest way to sort the ar

Re: [PHP-DB] Sorting a PHP array

2013-05-15 Thread Bastien
Bastien Koert On 2013-05-15, at 12:32 PM, "Charlie Lewis" wrote: > I have a bookseller database list read into a PHP array with dimensions > [row][field]. There are 32 fields in each record/row and up to 500 records. > > > > What is the neatest way to sort the array by any of the fields, su

Re: [PHP-DB] Sorting a PHP array

2013-05-15 Thread Matt Pelmear
I would use ORDER BY in your query and let the database do the work, assuming you're using a standard relational database (like MySQL or Postgresql). Otherwise, if you MUST do it in PHP, you could look at usort(), or uasort() using your own custom sorting function. I would, however, strong

[PHP-DB] Sorting a PHP array

2013-05-15 Thread Charlie Lewis
I have a bookseller database list read into a PHP array with dimensions [row][field]. There are 32 fields in each record/row and up to 500 records. What is the neatest way to sort the array by any of the fields, such as author or title? I know I should just search for a manual on this, but