Using dynamic with order_by

In that example you are sorting by a field in the first table. Where the guy ended up was quite different. He needed to be able to order by fields in multiple tables too.