How cakephp prints sql statements
This article is about how cakephp prints sql statements. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
The specific implementation methods are as follows:
Copy the following statements into your code, and you can print out all the previous sql statements:
$sources = ConnectionManager::sourceList (); if (! isset ($logs)): $logs = array (); foreach ($sources as $source): $db = & ConnectionManager::getDataSource ($source); if (! $db- > isInterfaceSupported ('getLog')): continue; endif; $logs [$source] = $db- > getLog (); endforeach; endif; thanks for reading! This is the end of the article on "how to print sql sentences in cakephp". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!