Q . How to print query in zend framework.

Mike Tyson. asked, Jun 22 ' 2015

Can anybody help me to print mysql query?

  • zend-framework2
  • mysql-query

1 Answers

Try this :-

 ZEND FRAMEWORK 1

 $db = $zendb->connect();
 $query = $db->select()->from('users');
 
 echo $query->__toString();

 

 ZF2

 $sqlObj = new Sql($dbAdapter);
 $query = $sqlObj->select()->from('users');
        
 echo $query->getSqlString();

 

Leave a Ansewer