Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想输出 Zend_Db_Table 的 select() 语句生成的查询以测试 porposes,但我不知道如何。
这真的很容易。select 对象实现了一个 toString 方法。
$select = $table->select()->.... echo $select; //prints SQL
或者
$sql = $select->__toString();
或将其转换为字符串然后使用它:
(string)$table->select();