开发者

what actually is ran through the query

开发者 https://www.devze.com 2023-04-01 14:20 出处:网络
how can I debug a query that it what its going to run, like $this->Article->find(\'all\',array开发者_Go百科(\'id\'=>123)); is probably running something like

how can I debug a query that it what its going to run, like $this->Article->find('all',array开发者_Go百科('id'=>123)); is probably running something like

select * from articles where article.id = 123; but how can I be sure and can see that in a debug or something. thanks


Set app/core/config.php debug = 2

http://book.cakephp.org/view/924/The-Configuration-Class#CakePHP-Core-Configuration-Variables-931


@Ken's answer is correct, but I would recommend you downloading the debug_kit plugin; as it provides far more information than the standard output.

You will need to enable debug, as stated in the other answer; but the plugin adds a whole host of extras such as logging, performance, full SQL queries, history, variable dumps etc - definitely makes things easier for testing and general debugging.

0

精彩评论

暂无评论...
验证码 换一张
取 消