Yii just igore some codes

hi, all

i have this action in Controller_photos :

$model=new Photos;

$photocate = new Photocate;





no errors after running.

i checked the database, i can see one new record in table_photos, nothing is in table_photocate.

really strange, Yii just igore these codes:

$photocate = new Photocate;



can someone help me, thanks!

What is the relationship between your models. Are your tables innodb with constraints?

give more details. You may tre ->save(false); to avoid validation if you’re just testing

thanks very much.

it is caused by a field with not null propertity.

it is very good to know save(false) can disnable verification.