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
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.