Multiple connections

Im trying to change a db connection on the fly but its a tough job!

From what i see it is impossible to alter the ‘db’ component predefined in yii::app(). The only way i have not yet tried is the write all the connections in the app() as components but this will be a mess to update so really looking for a way to alter the db connection.

Any ideas on how to alter the connection untill altered anew?

Even partial ideas are welcome as this is getting frustrating as ****

Right you are and thanks for that :)

But i was looking for an easier solution where you just changes the base db connection.

If you were to make a new connection on the fly, you would have the change CActiveRecord connection for the models that should show the information from the new db, making it a bit of a hassle (Im new, so i dont know if there is a smart way of doing this)

The multi domain is very nice as i got a dropdown list, which takes information from a connection model, needs to keep a connection to the same server no matter which the other models connect to.

Ill get right on that.

So, as im very new, which way would you say would be the easiest to do when i need to change the connection for a few models and keep the connect for one of them?

Thanks in advance!

If it is just for a few models I would follow the wiki tuto and create your own extended version of CActiveRecord and override