Debug database queries

Is there a way to show the query, which was really executed?

Let's look at this example:

Database::model()->find("test = ':test'', array('test' => 'name'));

Is there a way to show the "real" query like the following?



SELECT * FROM database WHERE test = 'name'


Have a look at this page:

http://www.yiiframew…/topics.logging

For instance, use CFileLogRoute. You'll find the log file in the protected/runtime directory.

/Tommy

Thanks for that hint.

Is there a way to retrieve all messages of a certain type and category in my application, so that I can display i.e. all 'info, trace' - messages of 'system.db' at the footer of the website?

I would really appreciate that…

The guide has explained that. You can define categories and levels filters to decide which messages to display.