While we’re trying to upgrade our system to a newer version of CakePHP where it’s easier to switch between databases, I currently have to get the 1.1.x version able to switch between databases.
I’ve tried using the fairly simple method shown on this post, however I can’t get this fully working. Debuging the $connected object does reveal all the information of the database I’m trying to save to, yet when I save something to the database I still end up changing the original database and not the second database. Anyone know of a method I can use to switch databases on cakePHP 1.1 or what might be going wrong with the method given on the site posted?
see this url:-
http://insanityville.com/2010/04/how-to-switch-between-databases-in-cakephp-on-the-fly/
Read it
I’m pretty sure some of the functions I used are specific to 1.2.
But you can try. I’ll give you a basic overview of what I did.
I made a componant, and inside the componant in the initialize
method.. I do this:
(all the connection data is stored in a Client Model, that I load with
loadModel)
And then in my app_model I set
Again, I’m not sure at all how well this will work in 1.1