You chose the right solution, the other would not have preserved the order of fields in the `ORDER BY` clause, which is kind of important.  Please not that short array syntax is not allowed, and please rename to `$existingOrders` 