I have a for-loop that returns the manufacturer name corresponding to a list of products:
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
$v_query = tep_db_query("SELECT manufacturers_id FROM ".TABLE_PRODUCTS." WHERE products_id = '".$order->products[$i]['id']."'");
$v = tep_db_fetch_array($v_query);
$mfg_query = tep_db_query("SELECT manufacturers_name FROM ".TABLE_MANUFACTURERS." WHERE manufacturers_id = '".$v['manufacturers_id']."'");
$mfg = tep_db_fetch_array($mfg_query);
echo $mfg['manufacturers_name'];
}
How do I return just one manufacturer name of the most frequently appearing one in the list? I can't seem to get the results properly assigned as an array in order to do an array count/search.