I am trying to output some content from my DB table, i successfully made a query and also return controller code but when i am trying ouput it in my view, what i tried
<tr>
<?php foreach ($products as $product) { ?>
<td>
<pre>
<?php
var_dump($products[$product['product_id']]['manufacturers']);
foreach ($products[$product['product_id']]['manufacturers'] as $manufacturer) {
echo $manufacturer;
} ?>
</pre>
</td>
<?php } ?>
</tr>
ERROR
Notice: Array to string conversion in C:\xampp\htdocs\usa\catalog\view\theme\usadevims\template\product\compare.tpl on line 72ArrayNotice: Array to string conversion in C:\xampp\htdocs\usa\catalog\view\theme\usadevims\template\product\compare.tpl on line 72ArrayNotice: Array to string conversion in C:\xampp\htdocs\usa\catalog\view\theme\usadevims\template\product\compare.tpl on line 72Array
and here the var_dump of my variable
array(3) {
[0]=>
array(2) {
["name"]=>
string(5) "Apple"
["manufacturer_id"]=>
string(1) "8"
}
[1]=>
array(2) {
["name"]=>
string(3) "HTC"
["manufacturer_id"]=>
string(1) "5"
}
[2]=>
array(2) {
["name"]=>
string(4) "Sony"
["manufacturer_id"]=>
string(2) "10"
}
}