Get latest SQL query

Posted by nikola, With 0 Comments, Category: CakePHP, Tags: , ,

When debugging CakePHP code, it's very useful to know which SQL query is executed latest.

Use next few lines to get this information

$log = $this->Model->getDataSource()->getLog(false, false);
debug($log);