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

Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'COUNT' #1121

Open
krishnamaurya-96 opened this issue Jul 10, 2024 · 1 comment

Comments

@krishnamaurya-96
Copy link

Information

  • Version of Medoo: 2.1.12
  • Version of PHP: 8.2
  • Type of Database: MySQL
  • System: Linux

Describe the Problem
Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'COUNT' But its working perfectly on php7.4 version.

Code Snippet
The detail code you are using that causes the problem:

$campaignCounts = $database->select('black_click', [
    'campaign_name',
    'COUNT(*) as total_clicks'
], [
    'GROUP' => 'campaign_name'
]);

Expected Behavior
A clear and concise description of what you expected to happen.

Actual Behavior
A clear and concise description of what actually happened.

@catfan
Copy link
Owner

catfan commented Jul 10, 2024

Use the raw object for the column.

https://medoo.in/api/raw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants