I very new to yii and need some help. I have a very simple demo app, where there are two tables:
USER
UserID (primary key)
Username
Password
RolesID (foreign key for Rolesdetails - RolesTableID)
And
ROLESDETAILS
RolesTableID (PK)
Roles
Its a very simple form with three fields - username, password and drop-down of roles. I want to create a new user and insert the data into both the tables.
However, not able to make any headway. I believe there is some issue with table integrity. The second table, Rolesdetails, has RolesTableID is foreign key of RolesID in User table.
I think I need to insert in Table RolesDetails first and look-up the ID and insert in to User table. All in one transaction. Looking at the blank wall as to how I should go about it. Any help would be great and superbly appreciated!!!