sean-keys
asked on
SELECT statement in Zend_Framework
I have th following code that will display all the rows in a table. I want to use a custom select statement to display data from more than one table. How can I do this with zend_db_table ? Or do i need to use another class?
$this->view->title = "Showing All";
$items = new Items();
$this->view->items = $items->fetchAll();
require_once 'Zend/Db/Table/Abstract.php';
class Items extends Zend_Db_Table_Abstract {
/**
* The default table name
*/
protected $_name = 't_items';
<p><a>Displaying Short View</a></p>
<table>
<tr>
<th>nickname</th>
<th>serial</th>
<th> </th>
</tr>
<?php foreach($this->items as $item) : ?>
<tr>
<td><?php echo $this->escape($item->nickname);?></td>
<td><?php echo $this->escape($item->serial);?></td>
<td>
<a href="<?php echo $this->url(array('controller'=>'index',
'action'=>'edit', 'id'=>$item->id));?>">Edit</a>
<a href="<?php echo $this->url(array('controller'=>'index',
'action'=>'delete', 'id'=>$item->id));?>">Delete</a>
</td>
</tr>
<?php endforeach; ?>
</table>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER