how to print out sql statement

I use AR to write data into datebase like this

$model = new user;

$model->attributes=$_POST['user'];

$model->save();

however when I check the database table, there is a field always missing, so I want to print out the sql statement which was sent to mysql server.

I did print_r the $model object, it seems like that all values were set in the attributes array

Thanks

Check this http://www.yiiframew…8.html#msg10468

Thanks for the reply, however , the query passed, just leave one field untouched, all other fields work fine. in the log, I only find exceptions. if it is not exception, it won't be shown there

great, change to weblog, I can see the query, thanks ;D