views:

1004

answers:

3

What is the method to save and update Many to Many relationship in Yii framework?

A: 

Unless you create a model for the table between the two main tables, your only option is to use DAO (Database Access Object) and specify SQLs with it.

Have a look at how blog demo accomplishes this task.

pestaa
A: 

use MANY_MANY relationship type to setup many to many connection between Models (An associative table is needed to break a many-to-many relationship into one-to-many relationships) And now you can use all relational functions of Active Records

http://www.yiiframework.com/doc/guide/database.arr