Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

eg...

$this->getSomeData->findAll();
Yii command to output this single query e.g SELECT * FROM TABLE...

Does Yii have a similar feature to simply show the very last query executed?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
310 views
Welcome To Ask or Share your Answers For Others

1 Answer

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,
        ),
    ),
),

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...