CodeIgniter Forums
Multi-database Project - Printable Version

+- CodeIgniter Forums (
+-- Forum: Using CodeIgniter (
+--- Forum: General Help (
+--- Thread: Multi-database Project (/thread-70000.html)

Multi-database Project - VigoKrumins - 02-07-2018

Hello CodeIgniter gurus!

Currently, I have two separated same projects only using different databases. When ever I do changes in the code, I've to update it on both projects which is a little bit a pain in the back.

I've an idea create a single project but using 3 (or more, depends on clients) databases.

1st database - MASTER DB.
This database has users table, clients table (with information about other databases, etc).

2nd database - Client One && 3rd database - Client Two
Structure in both databases are the same only different data.

P.S I can't merge 2nd and 3rd database into one database because I've created a web application for already existing system.

What would be the best way to do this?
I can create an authorization system which takes data from MASTER database. When user log-in, it saves in sessions which database it should work with. How to handle this multi-database problem? I should create my own Database model or what? :?

If you've any questions, feel free to ask.


RE: Multi-database Project - php_rocs - 02-07-2018


Maybe this is what you are looking for ( )?