Welcome Guest, Not a member yet? Register   Sign In
Connect to database with different credential for different user?

  First I'm beginner for CodeIgniter. Iam trying codeigniter for a new project.

In my site, there are three level of user.  Each user level have access to the certain tables in the database. If I use CodeIgniter for my project, How to connect with different Database credential when a user logged in?

(This post was last modified: 07-26-2017, 01:52 AM by qury.)

If i would be in a similar situation i would use the default db connection for administrative tasks (get global settings, user profile).

Then i would use a the user specific db connection to access other functions. Check the "Connecting to Multiple Databases" and "Manually Connecting to a Database" section in the guide.

Theme © iAndrew 2016 - Forum software by © MyBB