久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      yii2怎么修改數(shù)據(jù)庫連接

      yii2怎么修改數(shù)據(jù)庫連接

      配置多數(shù)據(jù)庫:

      return [     // ...     'components' => [         // ...         'db' => [             'class' => 'yiidbConnection',             'dsn' => 'mysql:host=localhost;dbname=example',             'username' => 'root',             'password' => '',             'charset' => 'utf8',         ],     'db2' => [             'class' => 'yiidbConnection',             'dsn' => 'mysql:host=localhost;dbname=example',             'username' => 'root',             'password' => '',             'charset' => 'utf8',         ],     ],     // ... ];

      (推薦教程:yii框架)

      如果在你的應用中應用了不止一個數(shù)據(jù)庫,且你需要給你的 AR 類使用不同的數(shù)據(jù)庫鏈接(DB connection) ,你可以覆蓋掉 yiidbActiveRecord::getDb() 方法:

      class Customer extends ActiveRecord{    // ...     public static function getDb()     {             return Yii::$app->db2;  // 使用名為 "db2" 的應用組件     } }

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號