PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, January 2, 2022

[FIXED] how can I print my sql string in yii?

 January 02, 2022     php, yii     No comments   

Issue

I'm using yii framework for implementing a new project. I want to see the sql string before it runs on the server. I already enabled this code in my configuration file but I still get no result

array('class'=>'CWebLogRoute',),

What should I do exactly to view the sql string when I run a webpage?


Solution

try to put this under components in main.php (config):

'log'=>array(
    'class'=>'CLogRouter',
    'routes'=>array(
        'weblogging'=>array(
            'class'=>'CWebLogRoute',
            'enabled'=>true,
            ),
        ),
    ),

then it will show debugging info along with all the sql ran on that page.



Answered By - Arfeen
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing