I tried using below code in Views > Global PHP field.
<?php
$request = db_query("SELECT data FROM {uc_order_products } WHERE order_id= $row->order_id")->fetchField();
$att = $request;
$data = unserialize($att);
if (is_array($data['attributes'])) {
foreach ($data['attributes'] as $attribute => $option) {
echo $attribute . ': ' . implode(', ', (array)$option) . '<br>';
}
}
?>
Adding above code I get the below error :
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Also how do I print each attribute in a different field?