i want to output the query generated by Zend_Db_Table's select() statement for testing porposes but i dont know how.
Asked
Active
Viewed 6,045 times
2 Answers
15
It's actually really easy. The select object implements a toString method.
$select = $table->select()->....
echo $select; //prints SQL
Or
$sql = $select->__toString();

David Snabel-Caunt
- 57,804
- 13
- 114
- 132
2
or cast it to string and then use it:
(string)$table->select();

fancyPants
- 50,732
- 33
- 89
- 96

obotezat
- 1,041
- 16
- 20