Abadis
Abadis

Reputation: 2821

Zend Framework Queries on Mysql

I am working with zend framework and I am new to it. The Site which is built has lots of transactions to/from mysql and there are lots of errors. Is there any way to understand the queries which are made by Zend Framework? If i could see them , I could easily change correct them but unfortunatly I didnt find how to do that. Thanks!

Upvotes: 0

Views: 104

Answers (1)

Mr Coder
Mr Coder

Reputation: 8186

Queries in ZF are instance of Zend_Db_Select , simply

$query = Zend_Db_Table::getDefaultAdapter()->select()->from('user')->where('id = ?',1);

To see its sql representation simply do

echo $query ; 

or 

echo $query->__toString();

Upvotes: 1

Related Questions