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

PDO::FETCH_KEY_PAIR errors when selecting not exactly 2 columns #553

Open
staabm opened this issue Feb 26, 2023 · 0 comments
Open

PDO::FETCH_KEY_PAIR errors when selecting not exactly 2 columns #553

staabm opened this issue Feb 26, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@staabm
Copy link
Owner

staabm commented Feb 26, 2023

    public function unknownWhereColumn(PDO $pdo)
    {
        $pdo->query('SELECT * FROM ada', PDO::FETCH_KEY_PAIR);
    }

SQLSTATE[HY000]: General error: PDO::FETCH_KEY_PAIR fetch mode requires the result set to contain exactly 2 columns.

@staabm staabm added the enhancement New feature or request label Feb 26, 2023
@staabm staabm changed the title PDO::FETCH_KEY_PAIR errors when selecting more then 2 columns PDO::FETCH_KEY_PAIR errors when selecting not exactly 2 columns Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant