ActiveRecord does not save
Here's a piece of code, no warning is issued. The model has the count field. Is not saved. I do not understand why.
save saves the new loaded from the database model. Check whether this field is a validation rule (rules method) and check all the methods models beforeValidate, beforeSave they must return true and better parent::beforeSave()
Answered: xomaa 22-06-2012 в 09:49:43
make it so
The method will show whether there are errors in validation.
Answered: chandler 22-06-2012 в 13:44:41
you are a model loaded from the database for a particular id) the save method saves a new field (obtained from the database, creating using the new operator) model in the database) then read - the paragraph the record is updated
there are two solutions, the first using the update() method or before the line file->save(); reset field CActiveRecord::isNewRecord is set to false, and then when you call the save method will actually be called update
Answered: Ale_x 22-06-2012 в 05:11:24
Disable validation when saving.
Answered: Barton 22-06-2012 в 10:26:21
If I'm not mistaken, the field
Pruflink: http://rmcreative.ru/blog/post/yii-1.1.8 Work with counters in the database through AR
Answered: VasyOk 27-07-2012 в 15:57:19
Well then get the error which occurs when you save and then we'll look further.
Answered: artem 27-07-2012 в 16:30:15