Yii Framework Forum: How to print the executed sql string from active record ? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

How to print the executed sql string from active record ? Rate Topic: -----

#1 User is offline   codezilla 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 14-July 09
  • Location:Thailand

Posted 18 August 2009 - 08:06 PM

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!
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

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.
0

#3 User is offline   codezilla 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 14-July 09
  • Location:Thailand

Posted 19 August 2009 - 04:33 AM

View PostMike, 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.


Hey Mike, thanks, that I knew. I guess, I want to hear the hardest one ? ???
0

#4 User is offline   hobs 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 09-June 11
  • Location:Borneo

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?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users