Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8368217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:20:07+00:00 2026-06-09T13:20:07+00:00

While we’re trying to upgrade our system to a newer version of CakePHP where

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:20:09+00:00Added an answer on June 9, 2026 at 1:20 pm

    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)

         $newDb =& ConnectionManager::create('myconn_name',
    array('driver' => 'mysql'
                    ,'host' => $client->data['Client']['db_host']
                    ,'login' => $client->data['Client']['db_login']
                    ,'password' => $client->data['Client']['db_password']
                    ,'database' => $client->data['Client']['db_name']
                    ,'persistent' => false
    

    And then in my app_model I set

     var $useDbConfig = 'myconn_name';
    

    Again, I’m not sure at all how well this will work in 1.1

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While I'm hoping to eventually switch to a newer, lighter, and/or faster DBMS (such
While trying to compile the following code, which is enhanced version of read build
While trying to build the mysql2 gem with ruby 1.9.2-p320 on Fedora 16, I
While playing with standard library i've found a strange difference between python2 and python3.
While I'm developing Android-Apps I like to have a look at internal SDK implementations.
While trying to call an EJB made using NETbeans (using jdk1.7) from a client
while working with linq query i'm receiving error System.NullReferenceException: Object reference not set to
While trying to install a program from source I found that it installed libraries
While I understand the Math.round/ceil/floor functions in javascript, I have been unable to come
While debugging my NServiceBus enabled application, I have certain messages that are reported in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.