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 5941765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:09:22+00:00 2026-05-22T16:09:22+00:00

I am using Zend 1.11 with Doctrine 1.1.4. My application uses multiple databases. In

  • 0

I am using Zend 1.11 with Doctrine 1.1.4. My application uses multiple databases.

In my bootstrap.php file, I’ve set up the details for two databases;

   $dbs = array(
        'global_users'=>array(
            'adapter' => 'mysqli',
            'params' => array(
                'host'     => 'localhost',
                'username' => 'root',
                'password' => '',
                'dbname'   => 'global_users',
                'charset'   => 'UTF8',
            ),
        ),
        'search_landscape'=>array(
            'adapter' => 'mysqli',
            'params' => array(
                'host'     => 'localhost',
                'username' => 'root',
                'password' => '',
                'dbname'   => 'search_landscape',
                'charset'   => 'UTF8',
            ),
        ),
    );

I’ve generated the Doctrine Model classes for the second database, search_landscape. I have not used the global_users database yet in the application whilst I have performed several Doctrine queries on the second database, search_landscape which is working as expected so far.

When performing the Doctrine queries, I am not defining an explicit connection to the database i.e it using the default connection, how does Doctrine know which database to connect to?

When I start to use the other databases in the application I understand I’ll have to define the Doctrine connection for each of them explicitly, however right now I have not defined any explicit connections yet Doctrine seems to know which db to connect to out of the two.

Appreciate the help.

  • 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-05-22T16:09:23+00:00Added an answer on May 22, 2026 at 4:09 pm
    Doctrine_Manager::getInstance()->getCurrentConnection();
    

    Doctrine_Manager is a singleton object, you can set other connections as default using their names. See the Doctrine_Manager API documentation for more info.

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

Sidebar

Related Questions

I'm using Doctrine 2 in a Zend Framework application and require functionality similar to
I am using Doctrine ORM for php and Zend MVC. I have a mysql
I am using Doctrine 2 and Zend Framework 1.11. I have set up my
I've been working with Zend Framework (using Doctrine as the ORM) for quite a
I'm using Zend Studio to do remote debugging of my php scripts on a
I'm using Zend Framework with Doctrine. I'm creating an object, editing, then saving it.
I'm using Doctrine with Zend Framework. For my model, I'm using a base class,
im using symfony with doctrine and zend. i wonder if i wanna validate the
I am processing a submitted Zend Form which updates a Doctrine Record using the
Right now I'm working on PHP. I am using the Doctrine ORM and the

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.