Hi guys, I have seen here somewhere about printing the executed sql from an active record, but I think I've lost it, searched but can't find it. So, please how do I return the sql string executed from ActiveRecord ?
Thanks!
Page 1 of 1
How to print the executed sql string from active record ?
#2
Posted 19 August 2009 - 03:01 AM
The easiest is to active CWebLogRoute. It adds debugging output to the bottom of every page.
http://www.yiiframew...oc/cookbook/34/
You can also set enableParamLogging=>true in your db component configuration.
http://www.yiiframew...oc/cookbook/34/
You can also set enableParamLogging=>true in your db component configuration.
#3
Posted 19 August 2009 - 04:33 AM
Mike, on 19 August 2009 - 03:01 AM, said:
The easiest is to active CWebLogRoute. It adds debugging output to the bottom of every page.
http://www.yiiframew...oc/cookbook/34/
You can also set enableParamLogging=>true in your db component configuration.
http://www.yiiframew...oc/cookbook/34/
You can also set enableParamLogging=>true in your db component configuration.
Hey Mike, thanks, that I knew. I guess, I want to hear the hardest one ?
#4
Posted 01 October 2011 - 12:24 AM
What about within phpunit test scripts when you want to print it to the console or display in some other way?
Share this topic:
Page 1 of 1

Help
This topic is locked











