CakePHP switch database (using same datasource) on the fly?
Made it work using this (create a new connection on the fly) : $newDbConfig = $this->dbConnect($serverConfig); $this->Model->useDbConfig = $newDbConfig[‘name’]; $this->Model->cacheQueries = false; With : /** * Connects to specified database * * @param array $config Server config to use {datasource:?, database:?} * @return array db->config on success, false on failure * @access public */ function … Read more