Capture sql query

Hello, i have searched information about this but i dont find what i need, maybe some of you can help me.

I work with openreports, so i’d like to get “in real time” (not in log) the executed query from advanded search of a admin page of yii.

If i get it, i can send query to the openreports (by parameter) and i can show the same result in pdf (throught openreport) like admin page of yii.

Sorry for my bad english.

Thanks everybody.

Kind regards.

Just an idea, but could you create a new log-route and use that to send the query to open reports?

Thanks for answer. I though about it, but i think that it is a little dirty to have to read the generated query of the log file to send it to openreports.

isn´t there some object in yii to get last query?

Thanks very much.

If using CDbCommand, you can get SQL via "text" property

Thanks for the answer, i was doing that but the final query that it show me is with parameters like ‘:ycp0’ (like the log), so do you know if it’s possible get the query with authentic values in parameters?

Thanks very much.

See my suggestion in this post.

At least I don’t know a better way to capture the final SQL statement.