In the Cakephp, the printing of last executed query is not so much good as CodeIgniter.
Here is the code, by using this we can print the last executed query in cakephp
$dbo = $this->ModelName->getDatasource(); $logs = $dbo->getLog(); $log = end($logs['log']); echo "<pre>"; print_r($log); echo "</pre>"; exit();
Now, you can see the last executed query.
Array ( [query] => SELECT * FROM ....... [params] => Array ( ) [affected] => 0 [numRows] => 0 [took] => 3 )