Relation Betwenn 2 Database

hello,

I would like to make a relation betweenn 2 table in 2 differents database :

the principal is the database which contain t_tarifsvente

in the model Personne




  public function relations() {

      

        return array(

    

            'PersonnesActif' => array(self::MANY_MANY, 'TTarifsvente',

                't_tarifsvente(fk_projet,fk_personne)',

                'order' => 'nom'),

        );

 }

    }

to have a connection with a second database, I put that code in the modelPersonne :




 public function getDbConnection() {

        return self::getPersonneDbConnection();

    }



thanks

Nath

Hello,

Try this extension - http://www.yiiframework.com/extension/multiactiverecord/. It has pretty good explanation of what need to be done in order to establish connection between 2 tables from different databases.