troubleshooting $model->save()

I’ve got a model that’s not saving, but I have no idea why. it returns 0, but there’s no error message. I’ve dumped the output of $model->getErrors() and it was empty.

How can I begin to troubleshoot this? How can I see, for example, what SQL statement it’s constructing? Or if it’s even getting to that point?

If you use beforeSave() remember to return true (call parent)

http://www.yiiframework.com/doc/api/1.0.10/CActiveRecord#beforeSave-detail

You can enable logging and check the generated SQL

http://www.yiiframework.com/doc/guide/topics.logging

/Tommy

yes, you are correct. I had a beforeSave method in the model and was not returning true. Thanks for your help. And for the link to the page on logging.