CakePHP - get last query run

Posted by Phantz on Stack Overflow See other posts from Stack Overflow or by Phantz
Published on 2010-03-26T04:59:39Z Indexed on 2010/03/26 5:03 UTC
Read the original article Hit count: 302

Filed under:
|
|

I want to get the last query CakePHP ran. I can't turn debug on in core.php and I can't run the code locally. I need a way to get the last sql query and log it to the error log without effecting the live site. This query is failing but is being run.

something like this would be great:

$this->log($this->ModelName->lastQuery);

Thanks in advance.

© Stack Overflow or respective owner

Related posts about cakephp

Related posts about mysql