I have a weird problem using Zend Framework and Mysql. I generated a request:
SELECT events.idUser, szForename, szLastname, readers.szName, idZoneFrom, events.dtTime FROM events, users, readers WHERE events.idUser = users.idUser AND events.idReader = readers.idReader AND dtTime >= '2010:02:15 0:00:00' AND dtTime < '2010:02:16 0:00:00' ORDER BY dtTime
The request works fine if I run it in some console, for example, pma, navicat or shell client, but when I try to run it using a model that extends Zend_Db_Table by command
$arResult = $this->getDefaultAdapter()->query($szQuery)->fetchAll();
it goes with error 1064:
enter code here
An error occurred
Application error
Exception information:
Message: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Stack trace:
Request Parameters:
array (
'controller' => 'index',
'action' => 'events',
'module' => 'default',
'idUser' => '0',
'dt' => '02/15/2010',
)
How can I debug it to find the problem? Or maybe you know what I could have done wrong?
ps. I use the same db user for both php and request testing ...
source
share