hi all, i want to output the query generated by Zend_Db_Table's select() statement for testing porposes but i dont know how.
views:
787answers:
1
+6
A:
It's actually really easy. The select object implements a toString method.
$select = $table->select()->....
echo $select; //prints SQL
Or
$sql = $select->__toString();
David Caunt
2009-07-16 15:11:12
or $sql = (string)$select;
smack0007
2009-07-17 14:05:57