Is there a way to get the SQL which would be run for a particular开发者_开发百科 find()
query, rather than actually running it?
For example:
echo $this->Users->find_sql('all');
// "SELECT User.id, User.username FROM users User WHERE 1=1"
My own situation would be a little more complicated than this, but I hope it illustrates the desired output.
found this article a while back
http://bakery.cakephp.org/articles/view/get-the-find-query-sql-rather-than-query-result
hope it helps
精彩评论