i want to output the query generated by Zend_Db_Table's select() statement for testing porposes but i dont know how.
It's actually really easy. The select object implements a toString method.
$select = $table->select()->....
echo $select; //prints SQL
Or
$sql = $select->__toString();
or cast it to string and then use it:
(string)$table->select();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With