Reputation: 1
I have a problem when using Zend classes db
, sql
and select
. My users table has 10 rows but returns results only 1 line.
File Model:
public function DbFetchAll ($ table) {
try {
$ select = $ this -> _ sql-> select ();
$ Select-> from ($ table);
$ statement = $ this -> _ sql-> prepareStatementForSqlObject ($ select);
$ result = $ statement-> execute () -> current ();
return $ result;
} Catch (Exception $ exc) {
echo $ exc-> getMessage ();
}
Upvotes: 0
Views: 23
Reputation: 2673
-> current ();
returning current pointing record. Try removing it. It should work.
Upvotes: 1