我使用了多个数据库连接。
主文件
'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)记录不更新
请帮我解决这个问题。
模型类
class Modelclass extends CActiveRecord
{
// model class code
}