CodeIgniter Forums
using multiple database on same application and issue with URI Routing - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: using multiple database on same application and issue with URI Routing (/showthread.php?tid=514)



using multiple database on same application and issue with URI Routing - dev_bikram - 12-12-2014

I am working on a small web application. In my application I follow the following approach.

Small Over view on system

1. The Application will be hosted on the server for example (www.example.com )
2. Clients such as Microsoft, Cocacola, IBM.... etc will sign up. And the clients will access the application by using url like this ( www.example.com/ibm )
3. Each client will have separate database to store their data.
4. If the employees of the client want to login into the system then the url pattern should be like this :
(www.example.com/ibm/user/login)
ibm - is the client
user - is controller
login - is method of user controller

How to achieve this?

Thanks in advance


RE: using multiple database on same application and issue with URI Routing - Rufnex - 12-12-2014

3) I would store it in a separate table if this is in your design ok, so its easyier to use.
4) You should go with CI3 and create a subfolder in your controller directory

PHP Code:
/controllers/ibm/User.php
/controllers/microsoft/User.php
... 

You can access it then by http://www.example.com/ibm/user/login etc.