Difference between #2 and #3 of
Multiple Databases and Multiple Domains

Revision #3 has been created by marcovtwout on Nov 9, 2010, 11:31:42 AM with the memo:

add emulate prepare and charset settings for second db
« previous (#2) next (#4) »

Changes

Title unchanged

Multiple Databases and Multiple Domains

Category unchanged

Tutorials

Yii version unchanged

Tags changed

database

Content changed

[...]
if(self::$db!==null)
return self::$db;
else
{

self::$db=new 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->emulatePrepare;



// Uncomment the following lines to prove that you have two database connections
/*
CVarDumper::dump(Yii::app()->db);
[...]
13 2
15 followers
Viewed: 55 353 times
Version: 1.1
Category: Tutorials
Tags: database
Written by: got 2 doodle
Last updated by: Maurizio Domba Cerin
Created on: Jul 30, 2010
Last updated: 13 years ago
Update Article

Revisions

View all history