ripper2020
12-13-2006, 10:38 AM
Hello all I am pretty new to php and am working on a page with some order statistics. My current array has all the data I need and is as follows:
if($unique[$x] != NULL){
$db_loco[$x]['city']= $unique[$x];
$db_loco[$x]['orders'] = $orders;
$db_loco[$x]['state'] = $db_res[$x]['vSState'];}
}
So I end up with city state and number of orders all with the same index. The problem is the user needs to be able to sort this array by order number, city, or state. I have no clue how to do this or if it is even possible with this array, if there is a better way of making the array please let me know, I was looking into array_multisort but couldn't figure out how to do it. Any help would be much appreciated thanx.
if($unique[$x] != NULL){
$db_loco[$x]['city']= $unique[$x];
$db_loco[$x]['orders'] = $orders;
$db_loco[$x]['state'] = $db_res[$x]['vSState'];}
}
So I end up with city state and number of orders all with the same index. The problem is the user needs to be able to sort this array by order number, city, or state. I have no clue how to do this or if it is even possible with this array, if there is a better way of making the array please let me know, I was looking into array_multisort but couldn't figure out how to do it. Any help would be much appreciated thanx.