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

  • Home
  • SEARCH
  • 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 7798413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:59:49+00:00 2026-06-01T23:59:49+00:00

I use multiple DB connections in my Codeigniter application. When I load dbforge it

  • 0

I use multiple DB connections in my Codeigniter application. When I load dbforge it loads it for the current db connection. How can I set dbforge so it work with the second DB connection?

  • 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-01T23:59:51+00:00Added an answer on June 1, 2026 at 11:59 pm

    In EE1 it used to be:

    mysql_select_db(<database name>);
    

    or

    $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
    mysql_select_db($dbname);
    ...
    mysql_close($conn);
    

    I believe looking at example code elsewhere you can still use this approach.

    For EE2 try:

    $this->EE->load->dbforge();
    $db = $this->EE->load->database(‘default’, TRUE);
    

    Where the first parameter is looking for the database config settings group.

    More info here:
    http://ellislab.com/codeigniter/user-guide/database/connecting.html

    Examples of the old EE1 approach still working in EE2 here:
    http://expressionengine.com/forums/viewthread/213519/#992669

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

Sidebar

Related Questions

I'm learning ODBC, and my application needs to use multiple connections concurrently. Should I
We know that a single application instance can use multiple cores and even multiple
We have a Windows application that can use multiple PCI adapters. These adapters all
I am looking for a tool capable of generating multiple Xmpp connections to load-test
Trying not to select same connection multiple times I have tried to use charindex()
my zend application uses multiple database connections, so i used the multidb resource to
I want to use multiple queries in one list view.In my list view each
Is it OK to use multiple inheritance if one parent class is an interface
I ask myself how use multiple images in one. For example youtube -> http://s.ytimg.com/yt/img/master-vfl102488.png
I need to use multiple hosts under IIS for WCF. We're using wshttpbinding and

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.