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