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 erro
This is a very late answer, i know, but for whoever needs this in the future, you can always restrict setting debug to your IP, For example:
Configure::write('debug', 0); if($_SERVER["REMOTE_ADDR"] == '192.168.0.100'){ Configure::write('debug', 2); //Enables debugging only for your IP. }