Get UC product attributes using Views Global PHP
If you use a variable in your request, it's preferable to use it like this : WHERE o.order_id = :oid', array(':oid' => $row->order_id).

So I guess it would be : 

$request = db_query('SELECT o.data FROM {uc_order_products} o WHERE o.order_id= :oid', array(':oid' =&gt; $row-&gt;order_id)')-&gt;fetchField();


To have different fields, you can do this processus for each field, by using multiple PhP fields in your view. But to rationalize requests, I would first do that request in the "setup code"  and set all your data in the $static variable.