0

I am working on a project which needs to connect with three databases, one in MySQL and the other two in MSSQL. I am using codeigniter as the framework and I can successfully connect to two databases. But when I try to connect to the third MSSQL database using the same method used to connect the second one, all the previous connections are gone. The database config arrays in database.php are correct.

The default configurations are for MySQL

I connected the second db as follows.

$mssql = $this->load->database('mssql1', TRUE);

And the third on as follows

$mssq2 = $this->load->database('mssql2', TRUE);

Thanks in advance

4

1 に答える 1

0

codeigniter DB_driver.php の simple_query 関数を変更して修正しました。

function simple_query($sql)
{
    if ( ! $this->conn_id)
    {
        $this->initialize();
    }
    $this->db_select();

    return $this->_execute($sql);
}

$this->db_select(); を追加しました。この機能に。助けてくれてありがとう

于 2013-03-20T12:35:43.580 に答える