Is there any built in functionality in ZF for logging the sql queries that
are used by Zend_DB?
Also, I am having a hard time figuring out how use LIMIT on a queries ,
using the select object gives me errors:

$config = Zend_Registry::get('config');

        $db = Zend_Db::factory($config->db->adapter,
$config->db->config->toArray());
        $select = $db->select();

         $select->from('lyricstest', '*')
         ->order('id')
         ->limit(0,5);

->fetchAll($select)

which gives me :



 PHP Warning:  PDO::quote() expects parameter 1 to be string, object given
in /usr/local/ZendFramework-1.0.1/library/Zend/Db/Adapter/Pdo/Abstract.php
on line 228
PHP Fatal error:  Uncaught exception 'Zend_Db_Statement_Exception' with
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 10' in
/usr/local/ZendFramework-1.0.1/library/Zend/Db/Statement/Pdo.php:227

It would be nice to see that query without setting my database engine to
start logging all queries.
Thanks,
Vinny
-- 
Ghetto Java: http://www.streetprogrammer.com

Reply via email to