Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Phalcon Pdo] Strange error when I try to fetch result as column #13321

Closed
oswebex opened this issue Mar 12, 2018 · 3 comments
Closed

[Phalcon Pdo] Strange error when I try to fetch result as column #13321

oswebex opened this issue Mar 12, 2018 · 3 comments
Assignees
Labels
bug A bug report status: low Low

Comments

@oswebex
Copy link

oswebex commented Mar 12, 2018

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

@sergeyklay sergeyklay self-assigned this Mar 28, 2018
@stale stale bot added the stale Stale issue - automatically closed label Jun 26, 2018
@stale stale bot closed this as completed Jun 27, 2018
@sergeyklay sergeyklay reopened this Jun 29, 2018
@stale stale bot removed the stale Stale issue - automatically closed label Jun 29, 2018
@stale stale bot added the stale Stale issue - automatically closed label Sep 27, 2018
@stale stale bot closed this as completed Sep 28, 2018
@niden niden added bug A bug report status: unverified Unverified and removed not verified labels Dec 23, 2019
@subdigger
Copy link

error still take place

@phalcon phalcon deleted a comment from stale bot Feb 21, 2020
@phalcon phalcon deleted a comment from stale bot Feb 21, 2020
@niden
Copy link
Member

niden commented Feb 21, 2020

@subdigger I will try to confirm this, this weekend with a test. Thanks for the heads up.

@niden niden reopened this Feb 21, 2020
@stale stale bot removed the stale Stale issue - automatically closed label Feb 21, 2020
@niden niden added the 4.0.5 label Feb 21, 2020
@niden niden added status: low Low and removed status: unverified Unverified labels Feb 23, 2020
@niden niden mentioned this issue Feb 23, 2020
5 tasks
niden added a commit that referenced this issue Feb 23, 2020
niden added a commit that referenced this issue Feb 23, 2020
niden added a commit that referenced this issue Feb 23, 2020
niden added a commit that referenced this issue Feb 23, 2020
niden added a commit that referenced this issue Feb 23, 2020
niden added a commit that referenced this issue Feb 23, 2020
niden added a commit that referenced this issue Feb 23, 2020
@niden
Copy link
Member

niden commented Feb 23, 2020

Resolved in #14869

Thanks for reporting this @ioscars

@niden niden closed this as completed Feb 23, 2020
@niden niden added this to Phalcon v5 Aug 25, 2022
@niden niden moved this to Released in Phalcon v5 Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: low Low
Projects
Archived in project
Development

No branches or pull requests

4 participants