Is it possible to take the results from an array from a database query and sort by one of the columns in the results? If so, how would that be done?
Here is an example of the array that I have:
Array ( [0] => stdClass Object ( [item] => 0 [size] => 2056515 [group] => SF2K [description] => 205/65R15 SAFFIRO SF2000 94V 40K [sort4] => 94 [sort5] => V [sort6] => [price] => 69.14 ) [1] => stdClass Object ( [item] => 8518 [size] => 2056515 [group] => FTOUR [description] => 205/65R15 FUZION TOUR BW 94H 40K [sort4] => 94 [sort5] => H [sort6] => [price] => 77.63 ) [2] => stdClass Object ( [item] => 106633 [size] => 2056515 [group] => SEREN [description] => 205/65R15 BS TURANZA SER+ 94H 80K [sort4] => 94 [sort5] => H [sort6] => [price] => 124.07 ) )
I would like to sort it by [price]. I know that in this example they are all already in numerical order, but they are not always.
ORDER BY
statement in your SQL query will be much better. – 1615903 Oct 8 '13 at 17:21