Setting the DB config from user input

Hi,

I need to set the DB config values(host name,db name, username,password) in the main config file from the user input form. Can any one suggest how to achive this.

You can collect this input in a form, then create a new dbConnection:




$db=new CDbConnection;

$db->userName=$form->userName;

Yii::app()->db=$db;



//not tested