Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (6.1k points)
Is there any of the way that one can cause CakePHP to dump its SQL log on demand? I would like to execute code up until a point in my controller and see what SQL has been run.

1 Answer

0 votes
by (12.7k points)
edited by

Try the following:

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

You will need to do this for each data source if you are having more than one though.

Check out here for more information.

Join the SQL Training course if you want to gain more knowledge in SQL.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jul 12, 2019 in SQL by Tech4ever (20.3k points)
0 votes
1 answer
asked Apr 26, 2020 in SQL by Sudhir_1997 (55.6k points)
0 votes
0 answers

Browse Categories

...