I would like to know if there is a way to do a multiple database system
For example I have many clients registered to my system and I want when the y login to select its databasse because I want to divide every client with an own database. Is this correct? Because I want to separate information of each client. Well, I think that i have to make multipl configuration into the database file of cakephp but I don't know hot to do this: When the client make the lgin (use default database), when they login I want to take a variable inside a table that contain the name of its database and after make it the active database.
is this possible? I can't declare foreach client the database configuration.
Can anyone help me in this?
Thanks
This is my actual default database in database.php
public $default = array (
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'login',
'password' => 'password_',
'database' => 'default_db',
'prefix' => ''
);
I would like to separate database because I want to create some pages where every client can edit filed of some tables because for example: if they want to add to table project field notes
, they can, anotoher client don't want this filed but many and many others. I would like to create a system to get the possibility to edit some table.
For that there are two solution:
- separate database at login in base of login
- use a unique database ad every time a user registered I create automatically its table for example there isn't table project
but project_{user_id}
for example, every user can have its table.
Which method is better?
Thanks