Medoo icon indicating copy to clipboard operation
Medoo copied to clipboard

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

Open krishnamaurya-96 opened this issue 1 year ago • 1 comments

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.

krishnamaurya-96 avatar Jul 10 '24 09:07 krishnamaurya-96

Use the raw object for the column.

https://medoo.in/api/raw

catfan avatar Jul 10 '24 18:07 catfan