Bubble, thanks for the reply, but I'm having the same difficulty with your suggestion as with the other solutions I've coded, the initial keys are lost after sorting and I really need to keep those, because they're sql record id's.
In other words, instead of:
[20] => Array
(
...
[sort] => 1
...
)
[19] => Array
(
...
[sort] => 3
...
)
)
I get:
[0] => Array
(
...
[sort] => 1
...
)
[1] => Array
(
...
[sort] => 3
...
)
)
I think that instead of using the record id's as the initial index, I'll code it to use a throwaway index and put the record key into the subarray, so instead of:
while(...){
...
$field_array[$id]['sort'] = "$field_sort";
...
$ndx++;
}
I'll use
$ndx=0;
while(...) {
...
$field_array[$ndx]['id']=$id;
$field_array[$ndx]['sort']=$sort;
...
}
then it won't matter that the index is reordered
Thanks again for the tip