CodeIgniter & DBForge - Create Database and Tables

后端 未结 7 2057
小蘑菇
小蘑菇 2020-12-16 05:34

I\'m trying to write a script in CodeIgniter that will create a database and then will add tables to that newly created database along with various fields in to the new tabl

7条回答
  •  南笙
    南笙 (楼主)
    2020-12-16 06:13

    change database connection of codeigniter migration

    I've used the suggestion provided in the above question to resolve my problem. After I create the second database I used the following command to switch to it:

    $this->db->query('use db2');
    

    This lets me create the tables in db2. Then used the following to switch back to the default database:

    $this->db->query('use DB1');
    

    Works exactly how I want it.

提交回复
热议问题