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

How to pass fetch mode specific parameters?

How shold I pass each fetch mode spesific parameters (https://php.net/manual/en/pdostatement.setfetchmode.php) in the following statment. Here I need to pass the colno parameter.

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

Currently I get this error: SQLSTATE[HY000]: General error: fetch mode requires the colno argument



16.3k

I confirm the problem