Yes, I did see an earlier post on loading database values into an array, but I have a twist to it. The reason I'm even loading my recordset into an array is because I want to do a natural sort on an element of the recordset.
I have the following query:
"SELECT camera_id, manufacturer_name, model_name
FROM camera_general
ORDER BY model_name"
Regular sorting on the model_name gives me results as follows:
Canon PowerShot A10
Canon PowerShot A100
Canon PowerShot A30
FujiFilm FinePix 1300
FujiFilm FinePix 1400
FujiFilm MX-1200
FujiFilm MX-1700 Zoom
FujiFilm MX-600 Zoom
When I need to display in the following order:
Canon PowerShot A10
Canon PowerShot A30
Canon PowerShot A100
FujiFilm FinePix 1300
FujiFilm FinePix 1400
FujiFilm MX-1200
FujiFilm MX-600 Zoom
FujiFilm MX-1700 Zoom
I was told that I should load the results into an array and then use the natsort() function:
http://www.php.net/manual/en/function.natsort.php
But looking through all my books, I'm not making the connection as to how my results into an array, and apply the natsort() function to the model_name element. Sample code anyone, or a huge push in the right direction, would be greatly appreciated?
Thanks!