42S22 SQL error: Column not found, why?

Posted by Vincenzo on Stack Overflow See other posts from Stack Overflow or by Vincenzo
Published on 2010-05-20T13:55:55Z Indexed on 2010/05/20 14:00 UTC
Read the original article Hit count: 131

Filed under:
|

This is my SQL:

SELECT `tbl`.*, 123 AS `test` FROM `tbl` GROUP BY `test`

It works when I run it directly in MySQL. But PDO says:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'test' in 'field list'

Why so? How to cure this problem? I'm using Zend_Db.

© Stack Overflow or respective owner

Related posts about php

Related posts about zend-framework