Bon Le
Bon Le

Reputation: 1

error when using Zend classes \ db \ sql \ select

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

Answers (1)

Bilal
Bilal

Reputation: 2673

-> current (); returning current pointing record. Try removing it. It should work.

Upvotes: 1

Related Questions