By default, fetchAll() returns an array of rows, each of which is an
associative array.
http://framework.zend.com/manual/en/zend.db.html#zend.db.adapter.select.fetch-mode
your current fetchEntries()->toArray() is the equiv to:
SELECT `location`.* FROM `location`
returns :
array(2) {
[0] => array(1) {
["locname"] => string(9) "location1"
}
[1] => array(1) {
["locname"] => string(9) "location2"
}
}
Using the adapter fetchPairs method will work:
$table = $this->getTable();
$adapter = $table->getAdapter();
return $adapter->fetchPairs('select locname, locname FROM locations');
http://framework.zend.com/manual/en/zend.db.html#zend.db.adapter.select.fetchpairs
--
View this message in context:
http://www.nabble.com/Array-Index-included-question--tp21776975p21777840.html
Sent from the Zend Framework mailing list archive at Nabble.com.