The query involves multiple subqueries and a few joins -- so I think this is
what may be causing the problem. By the time the query gets to the
Db/Statement/Pdo.php (228) it is no longer what I had originally passed in,
but a simpler query that is altered. This raises a PDOException.
The query isn't empty because if I do "throw new Exception($sql);" an
exception is raised and I see the full query.
Anyways, I think I'll just revert to some manual MySQL querying and bypass
PDO altogether. Not really elegant at all, but it should work.
jbennett55 wrote:
>
> Hi,
>
> I am getting this error from Zend Framework in my action controller:
> SQLSTATE[42000]: Syntax error or access violation: 1065 Query was empty
>
> There seem to be a number of resources online that point to setting the
> setIntegrityCheck to false on the select object:
> http://www.zfforums.com/zend-framework-components-13/databases-20/problems-join-672.html
>
> However, I am using a manual query and not a select object. Any
> suggestions?
> $sql = "<complex sql statement>";
> $result = $db->fetchAll($sql);
>
> Thanks.
>
--
View this message in context: http://www.nabble.com/Zend-Db-Manual-Query-Problems-tp20413641p20425766.html
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论