我已经将 main.php 配置为处理多个数据库,然后 gii 也给出错误我的 main.php 具有以下连接设置
'db'=>array(
'class' => 'CDbConnection',
'connectionString' => 'mysql:host='.$dbhost.';dbname='.DATABASENAME,
'emulatePrepare' => true,
'username' => YII_DB_UNAME,
'password' => YII_DB_PASS,
'charset' => 'utf8',
),
'db_transport'=>array(
'class' => 'CDbConnection',
'connectionString' => 'mysql:host='.$dbhost.';dbname='.YII_TRANSPORT_DB,
'emulatePrepare' => true,
'username' => YII_DB_UNAME,
'password' => YII_DB_PASS,
'charset' => 'utf8',
),
'db_admission'=>array(
'class' => 'CDbConnection',
'connectionString' => 'mysql:host='.$dbhost.';dbname='.YII_ADMISSION_DB,
'emulatePrepare' => true,
'username' => YII_DB_UNAME,
'password' => YII_DB_PASS,
'charset' => 'utf8',
),
'db_extendedsims'=>array(
'class' => 'CDbConnection',
'connectionString' => 'mysql:host='.$dbhost.';dbname='.YII_EXTENDEDSIMS_DB,
'emulatePrepare' => true,
'username' => YII_DB_UNAME,
'password' => YII_DB_PASS,
'charset' => 'utf8',
),
现在,当我使用 GII 并在数据库连接中写“db”(不带引号)时,它可以工作,但如果我写“db_extendedsims”,它就不起作用。我应该怎么做才能使它适用于所有连接