Revision #4 has been created by marcovtwout on Nov 9, 2010, 11:40:54 AM with the memo:
set all config properties
« previous (#3) next (#5) »
Changes
Title
unchanged
Multiple Databases and Multiple Domains
Category
unchanged
Tutorials
Yii version
unchanged
Tags
unchanged
database
Content
changed
[...]
if(self::$db!==null)
return self::$db;
else
{
self::$db=new // Create CDbConnection
(Yii::app()->db2->connectionString,Yii::app()->db2->username,Yii::app()->db2->password);
if (isset(Yii::app()->db2->charset))
self::$db->charset = Yii::app()->db2->charset;
if (isset(Yii::app()->db2->emulatePrepare))
self::$db->emulatePrepare = Yii::app()->db2->emulatePrepar and set properties
self::$db = new CDbConnection();
foreach(Yii::app()->db2 as $key => $value)
self::$db->$key = $value;
// Uncomment the following lines to prove that you have two database connections
/*
CVarDumper::dump(Yii::app()->db);[...]