cphalcon
cphalcon copied to clipboard
[Phalcon Pdo] Strange error when I try to fetch result as column
I can't fetch result as column, but if directly use PDO then the result is right. And I got a strange error.
SQLSTATE[HY000]: General error: colno must be an integer
Provide minimal script to reproduce the issue
$list = $this->db
->fetchAll('SELECT id FROM tbl WHERE status = -2', \Phalcon\Db::FETCH_COLUMN);
// or
$result = $this->db->query('SELECT id FROM tbl WHERE status = -2');
$result->setFetchMode(\Phalcon\Db::FETCH_COLUMN);
$list = $result->fetchAll();
// directly PDO work well
$list = $this->db->getInternalHandler()
->query('SELECT id FROM tbl WHERE status = -2')
->fetchAll(PDO::FETCH_COLUMN);
Details
- Phalcon version: 3.3.2
- PHP Version: 7.2.3 (https://packages.sury.org/php)
- Operating System: Debian GNU/Linux 9.4 (stretch) x86_64
- Installation type: installing via package manager (https://packagecloud.io/phalcon/stable/debian)
- Zephir version (if any): 0.10.7-2917ebe8ae
- Execute: Cli
- Other related info (Database, table schema): MariaDB 10.1, InnoDB
error still take place
@subdigger I will try to confirm this, this weekend with a test. Thanks for the heads up.
Resolved in https://github.com/phalcon/cphalcon/pull/14869
Thanks for reporting this @ioscars