0
我已經使用了多個數據庫連接。Yii1使用第二個數據庫連接的訪問模型類。多個數據庫連接
main.php
'components'=>array(
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=testdrive',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'charset' => 'utf8',
),
'db2'=>array(
'connectionString' => 'mysql:host=remotelocalhost;dbname=seconddb',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'class'=>'CDbConnection'
),
),
)
當模型類使用的第二個數據庫連接(遠程數據庫 - DB2)記錄未更新
PLZ幫我解決這個問題。
模型類
class Modelclass extends CActiveRecord
{
// model class code
}
如何你使用連接.....你可以請張貼更多的代碼 – lakshay
最後我找出解決方案。謝謝lakshay。 – Kailas