【发布时间】:2014-02-09 09:59:57
【问题描述】:
我在数据库配置文件中设置了两个不同的连接。一旦我连接到其中一个数据库,如果我连接到第二个数据库,连接仍然没有改变。我收到 table not found 错误。
$this->load->database(); //connecting to default db
$this->db->query('SELECT * from user'); //user table in default db and no error
$this->load->database('second_db');//connecting to second db
$this->db->load('SELECT * from statistic'); //table exists in second db but getting error
//The same work if I comment the first two lines
【问题讨论】:
-
@cornelb 实际上我想更改默认数据库连接($this->db),而不是试图在另一个变量中获得第二个连接。
标签: php codeigniter codeigniter-2