I have created two tables with two primary keys and one foreign key (reference of first table) and when I applied gii crud to those tables first one with out fk is ok . But the problem is if the id (10 eg) is not there in first table and trying add the non existing value(eg 10) in referencing table its giving error. I know the error is unless we dont have entries in main table we can enter the values in another table. When I apply crud operations using gii am getting error.
you are trying to insert into your child table when u dont have related entry in your parent table. try to insert that parent id in your parent table. then you can add the same key id in your child table.