0
我很困惑與Zend 2聯同多列顯示的查詢,而無法顯示這些列需要幫助的連接查詢Zend框架2
StudTable.php
public function custom_query() {
$select = new Select();
$select->from(array('s' => 'stud'));
$select->columns(array('s.id','a.artist', 's.name', 's.sem','s.age'));
//$select->where(array('id' => 14));
$select->join(array('a' => 'album'),
'a.id = s.album_id');
$select->order('s.id DESC');
$select->limit(5);
return $resultSet = $this->tableGateway->selectWith($select);
}
指數一個.phtml
<ul>
<?php foreach ($this->customeObject as $obj_cus) : ?>
<li>ID: <?php echo $obj_cus->id?>| Artist: <?php echo $obj_cus->artist?> | Name:<?php echo $obj_cus->name?> | Sem:<?php echo $obj_cus->sem?> | Age:<?php echo $obj_cus->age?></li>
<?php endforeach; ?>
</ul>