Insert Update Many To Many

Can someone point me to a resources or example how to go about it?

Scenario:There is a Member table(members are companies represented by directors,partners). A company can have many directors and a person can be directors in many companies.

Company table - id, company_name

Directors table - id, directors_name

company_director - company_id, directors_id

Now I have forms for adding data for company as well as directors, but how do I relate directors with the company.

I want that on saving the company form it is directed to directors form(simple changing the link save button link will do it),

[list=1]

[*]Before I add director, I want to find and check if a person already exist and if yes, just link and save the same with current company as well.

[*]But how the data entered here can be related to the Company? That is the ids for company table and directors table should be inserted in the company_director table.

[*]At the end of the form I want options like save and add another, which should present another blank form.

[/list]

I can’t find any wiki even for yii 1.1 which I could try to replicate in the given situation as above.

Thanks.