Yii - echo the last query

前端 未结 1 349
北荒
北荒 2020-12-11 07:14

I have used Codeigniter before and it has a feature that will echo the last database query - really useful for debugging.

eg...

$this->getSomeData         


        
相关标签:
1条回答
  • 2020-12-11 07:48

    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,
            ),
        ),
    ),
    
    0 讨论(0)
提交回复
热议问题