我想在我的表“地区”中加载我所有的列“名称”行。
我已经可以阅读第一行,但不能再多读了。
我的控制器:
public function showdataAction()
{
$districtMapper = new Backoffice_Model_DistrictMapper();
$array = $districtMapper->read();
Zend_Debug::dump($array);
}
我的地区地图:
public function read()
{
$table = $this->_dbTable;
$columns = array('wijk' => 'wijk', 'coords' => 'coords', );
$select = $table->select() ->from($table, $columns) ->order('wijk ASC');
if ($row = $table->fetchRow($select)) {
return $row->toArray();
}
throw new Exception('The requested data cannot be found');
}
在我的控制器中,我有 Zend_Debug::dump($array) ,结果是:
array(2) {
["wijk"] => string(10) "Binnenstad"
["coords"] => string(2186) "3.72448685517794,51.0601522198842,
0 3.72577413282654,51.0597215800093,0 3.72594328459339,
51.0600395135711,0 3.72699385985136, 51.060876600363,
0 3.72764765694006,51.0608474287073,
0 3.7281167878913,51.0605006616679,0 3.72955689560896,
51.059999738927"
}
只有第一行......我怎样才能转换读取功能,以便我可以加载所有行?