Multiple database connection in codeigniter application

Generally we use one database for application but some times we need to use multiple database.
Codeigniter give the option to connect multiple database in application.
This tutorial gives idea about how you can connect and use multiple databases in CodeIgniter Application.

Normally, we have a default database group, like so:
Notice that the login information and settings are provided in the array named $db[‘default’].
For multiple database connection, You can then add another database in a new array – let’s we name it as ‘seconddb‘.
while using multiple database connection in codeignter, you have to send the connection to another variabel that you can use in your model:
Hope this simple tutorial will help you get started with using codeigniter multiple database connection file upload functionality. If you are having problem or have a question, feel free to ask me about it. Happy coding ?

Add a Comment

Your email address will not be published. Required fields are marked *