yii 显示mysql执行语句显示防注入变量值

来源:互联网 发布:vb单击按钮显示文字 编辑:程序博客网 时间:2024/06/08 03:05

访问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',
     'categories'=> 'system.db*',
    ),
   
   ),
  ),

0 0
原创粉丝点击