malike 发表于 2018-2-11 12:08:25


            本文实例讲述了Yii调试查看执行SQL语句的方法。分享给大家供大家参考,具体如下:
开户debug
修改配置文件 :protected/config/main.php,
'log' => array(
'class' => 'CLogRouter',
'routes' => array(
    array(
      'class' => 'CFileLogRoute',
      'levels' => 'trace, info, error, warning',
    ),
    // uncomment the following to show log messages on web pages
    array(
      'class' => 'CWebLogRoute',
      'levels' => 'trace', //级别为trace
      'categories' => 'system.db.*' //只显示关于数据库信息,包括数据库连接,数据库执行语句
    ),
),
),
页: [1]
查看完整版本: Yii调试查看执行SQL语句的方法