I'm not sure if this is what you're asking, but as far as I know changing the value of an array item doesn't change its position in the array unless you sort the array.
Approaching it from another angle, you can write your database insert to set fields specifically by their names:
INSERT INTO table SET field1 = 'value1', field2 = 'value2', . . .
In that case I don't think the 'order' of things matters as far as the database is concerned.
Hope that helps a bit.