Multiple Database Connection in PHP CodeIgniter | Switch dynamic database from other DB

Published: 23 April 2022
on channel: Knowledge Thrusters
4,338
30

Multiple Database Connection in PHP CodeIgniter | Switch dynamic database from other DB. In this video tutorial, you will be able to connect multiple databases in CodeIgniter.

Steps:
Load your default database in database.php
Then create a database in which you will be storing all the database credentials
Fetch Credentials according to url segment
In url, i am taking id of a particular database connnection
There are different ways you will be getting your database credentials
Get your database credentials

Then, create a database config array in which pass your database credentials like hostname, username, password and database name

Then load the database and make a connection with that database.


Link:
Connecting to your Database
https://codeigniter.com/userguide3/da...

Database Configuration
https://codeigniter.com/userguide3/da...


On this page of the site you can watch the video online Multiple Database Connection in PHP CodeIgniter | Switch dynamic database from other DB with a duration of hours minute second in good quality, which was uploaded by the user Knowledge Thrusters 23 April 2022, share the link with friends and acquaintances, this video has already been watched 4,338 times on youtube and it was liked by 30 viewers. Enjoy your viewing!