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
A better way is to get a dbforge class representing the database you want to manipulate
$this->myforge = $this->load->dbforge($this->other_db, TRUE);
Use the $this->myforge
object to work as usual.
This method will avoid conflicts when building libraries. It's best not to mess with the default database of your library users at run time.