I'm searching a way to create a variable database in Cakephp. I'm creating a website in wich the database setting (user, pass, db) depends of the user who logg's in. The database settings come from another database. Thanks in advance,
Aäron
-- ANSWER
Thanks for your quick reply. I know how to switch between databases, but the database settings have to be variable. Example
$db = $this->DB_SET['DB_SET']['db']; //from model DB_SET the database
$db_login= $this->DB_SET['DB_SET']['login'];
$db_host= $this->DB_SET['DB_SET']['host'];
$db_pass= $this->DB_SET['DB_SET']['pass'];
var $db2 = array(
'driver' => 'mysql',
'persistent' => false,
'host' => $db_host,
'login' => $db_login,
'password' => $db_pass,
'database' => $db,
'prefix' => '',
'encoding' => 'UTF8',
'port' => '',
);