CodeIgniter & DBForge - Create Database and Tables

后端 未结 7 2025
小蘑菇
小蘑菇 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:00

    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.

提交回复
热议问题