Connect Multiple Databases in CodeIgniter

(Last Updated On: July 13, 2017)

Connect Multiple Databases in CodeIgniter

Today in this CodeIgniter tutorial I’m going to show you how to Connect Multiple Databases in CodeIgniter.

Connect Multiple Databases in CodeIgniter

Open the fileapplication/config/database.php and specify the settings of the another database.

See Also: CodeIgniter CRUD using Ajax, Bootstrap, Models, and MySQL

Connection with Multiple Databases

Connecting with multiple databases at once, load the databases like below.

Set the second parameter to TRUE to get the database object.

Use Multiple Database in CodeIgniter

Now you can access multiple database connections by the database object.


So today we learned the basic CodeIgniter database connection, in which we made Connect Multiple Databases in CodeIgniter Application.I hope you guys learned alot from it.If you guys have any problem regarding Connecting Multiple Databases in CodeIgniter let us know by commenting here.If you find this information useful, remember to share it on your social network.

Read previous post:
Angularjs Login Script using PHP MySQL and Bootstrap
AngularJS Login Script using PHP MySQL Bootstrap

In this tutorial, we will learn AngularJS login system.So I will explain how you can make AngularJS Login Script using...