Record Saved but it dosn't exist in database !

Hi , I’m really getting mad

I set all my fields as safe.

Validations are ok,

when I Save() it return true and return the new PK

and in the database, the Auto increment increased.

But nothing saved to database

 [CActiveRecord:_attributes] => array


        'title' => 'کوچک (2mp)'

        'filename' => '56c82e1a-fe48-4325-8926-7c485ff401cb.jpg'

        'size' => 506903

        'product_id' => '217'

        'id' => '277'


    [CActiveRecord:_related] => array()

    [CActiveRecord:_c] => null

    [CActiveRecord:_pk] => '277'

    [CActiveRecord:_alias] => 't'

    [CModel:_errors] => array()

Is there any idea what’s going on ?

Thanks in advance

  • Are you sure that you are checking the right database?

  • Are you doing this inside a transaction (and it is not committed)?

You can create some test code and do a ModelClass::model()->findByPk(277) . If you find the value you saved in the previous session, the value is saved allright, but you are not looking in the right location.

paste your rules and controller

Thanks, you’re right

There was a transaction in one of my Models