Yii Dynamic DB Connection according to user with a master database

Closed - This job posting has been filled and work has been completed.
Web, Mobile & Software Dev Web Development Posted 3 years ago

Fixed Price

Budget: $20
Delivery by March 15, 2013

Start Date

February 9, 2013


My project is on the basis of multi-tenent SaaS.

I have multiple clients (companies) and each client has multiple users - they all will use the same database layout.

Each client has their own database, so during user authentication, I want to Build a master database that associates the user with a company database for that user.

The structure of each database is identical... only the data is different.

So that we can keep the different database for the different company, that will not going to mix in data in database.

The number of clients (and therefor the number of databases) is unknown when the application is written, so it is not possible to include all the connections in the bootstrap script.

Now, what I want to do is, dynamically alter the DB connection that is in the bootstrap or have the ability to dynamically create a new connection for the user signing in. Is there a simple solution for this in Yii and still use AR , query builder ?

I saw this solution but not working for me http://www.yiiframework.com/forum/index.php?/topic/5385-dynamic-db-connection/

need someone to fix my issue

About the Client

(4.69) 30 reviews

United States
Miami Beach 04:46 AM

124 Jobs Posted
52% Hire Rate, 1 Open Job

$7,885 Total Spent
72 Hires, 1 Active

$2.64/hr Avg Hourly Rate Paid
2,782 Hours

Member Since Feb 9, 2010