yii 页面显示mysql执行语句的过程

访问protected/config/main.php修改如下 

'db'=>array(
  'connectionString' => 'mysql:host=localhost;dbname=yii_computer',
  'emulatePrepare' => true,
  'username' => 'root',
  'password' => '',
  'charset' => 'utf8',
  'tablePrefix' => 'yii_computer_',
  //让捆绑的变量显示出来
  'enableProfiling' => YII_DEBUG,
  'enableParamLogging' =>YII_DEBUG,
),

'log'=>array(
  'class'=>'CLogRouter',
  'routes'=>array(
    array(
      'class'=>'CFileLogRoute',
      'levels'=>'error, warning',
    ),

    //uncomment the following to show log messages on web pages
    array(
      'class'=>'CWebLogRoute',
      //添加的内容
      'levels' =>'trace',  //级别为trace  
      'categories' => 'system.db*', //只显示关于数据库信息,包括数据库连接,数据库执行语句  
    ), 
  ),
),
原文地址:https://www.cnblogs.com/zwue/p/4485422.html