I've done this:
in the controller:
-----------------------------------------------
$db = Zend::registry('db');
$sql = $db->select();
$sql->from('products', '*');
$sql->join('product_format', 'products.product_format_id = product_format.id', '*');
$view->productsList = $db->fetchAll($sql);
-----------------------------------------------
in the view:
-----------------------------------------------
<?php foreach($this->productsList as $product) : ?>
<option value="<?php echo $this->escape($product->id);?>"><?php echo $this->escape($product->productDesc) . ' - ' . $this->escape($product->productFormatDesc);?></option>
<?php endforeach; ?>
-----------------------------------------------
and I'm receiving an error:
Trying to get property of non-object in product_search.php on line 11
I just can't figure it out - where am I going wrong?
|