We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Fetching scaler value

How can I fetch a scaler value from DB. Using following return Fatal error: Undefined class constant 'FETCH_COLUMN' in... error.

$this->di['db']->fetchOne('select * from user where username=:username and password=:password', Phalcon\Db::FETCH_COLUMN,
                ['username' => $request['username'], 'password' => $request['password']]);


51.2k

Namespace problem maybe ?

\Phalcon\Db::FETCH_COLUMN


22.1k
edited Jan '15

@Calin No, the FETCH_* constants work correctly.



22.1k
Accepted
answer
edited Jan '15

Upgradiing to 1.3 from 1.2, now it recoginse that mode.