Assuming your database.php has the $default connection set, you can
just replace the details on the fly

DATABASE_CONFIG::default = array(<new connection details>);

At least I think that would word since its all static.  You might need
to import first though I dont think so.

On Dec 3, 3:09 pm, Henrik Gemal <[EMAIL PROTECTED]> wrote:
> I need to change the host and the database from the controller.
>
> The controller will read some config vars in the local database and
> the then needs to connect to the host and database specified in the
> config vars. These config vars changes all the time.
>
> So how do I dynamically change the database connection from within the
> controller?
>
> The database schema will be the same for all hosts and databases.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to