にクエリを結合するカスタムで助けを必要とし、それらの列に私はZendの2は、複数の列の表示とクエリに参加して混乱していますZend Frameworkに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);
}
インデックス
<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>