can't help you with the php, but you should be aware that this won't work the way you think it will --
ORDER BY '$metrics_order_col'
no matter what value $metrics_order_col might have, if you put quotes around it, it's a string, and then all the rows will be sorted by the same value, i.e. unpredictably
I removed the quote. Thanks.
I'm still returning only one row however.