本文介紹了Yii - 回顯上一個查詢的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
我以前使用過 Codeigniter,它有一個功能可以回顯上一個數據庫查詢 - 對于調試非常有用.
I have used Codeigniter before and it has a feature that will echo the last database query - really useful for debugging.
例如...
$this->getSomeData->findAll();
Yii command to output this single query e.g SELECT * FROM TABLE...
Yii 是否有類似的功能來簡單地顯示最后執行的查詢?
Does Yii have a similar feature to simply show the very last query executed?
推薦答案
在您的配置文件中試試這個.您可以在頁面底部查看查詢和其他詳細信息.
Try this in your config file. You can see the query and other details at the bottom of the page.
'db'=>array(
'enableProfiling'=>true,
'enableParamLogging' => true,
),
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
…
array(
'class'=>'CProfileLogRoute',
'levels'=>'profile',
'enabled'=>true,
),
),
),
這篇關于Yii - 回顯上一個查詢的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!