Link to home
Start Free TrialLog in
Avatar of sean-keys
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>&nbsp;</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>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of - -
- -
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sean-keys
sean-keys

ASKER

Thanks!