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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:45:45+00:00 2026-05-16T22:45:45+00:00

I am confused as to how to configure CodeIgniter to use more than one

  • 0

I am confused as to how to configure CodeIgniter to use more than one database. I have data in an Oracle database retrieved via PDO and a MySQL db which is using the “built in” configuration for CI. From what I can see, I only have the main configuration file that allows me to config one database (in this case the MySQL one)

How do I get data back from more than one database in the same webpage/view? Say I have MySQL built in to the main config page. Do I just make another connection in my controller (do I do it the “regular” old non-framework way), fetch my array and send that array to the view? In other words my main configured database can use the built in CI activerecord type queries but my other databases can’t take advantage of that?

Is this pretty much the way it is with all php frameworks? YOu end up making connections in your controller, the old fashioned way, and sending data to the view?

Thanks.

EDIT: I guess I’m saying the model for the second database ends up in the controller…which is bad isn’t it?

EDIT: Oracle was just an example. It could be any database CI can natively talk to.

EDIT: For CI, I think this is the answer:

http://codeigniter.com/user_guide/database/connecting.html

though I’m not sure how to use it.

EDIT: Found it here too: http://www.gotphp.com/codeigniter-multiple-database-support/5468/ better.

— these are assuming the built in drivers for CI. this does not answer then you have multiple databases and non-CI drivers

  • 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-16T22:45:45+00:00Added an answer on May 16, 2026 at 10:45 pm

    You could consolidate the connection info for CodeIgniter to only use the Oracle database, because Oracle has functionality called a “database link” to allow you to connect to other databases (including different vendors like MySQL). CodeIgniter would only know of the Oracle database, and queries to the MySQL instance would have to pass through the Oracle instance. There are details on the setup for a database link to a MySQL instance in this article.

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

Sidebar

Related Questions

I'm a little confused as to how to configure my Apache server. I'm using
I'm using SQLite as my database, and I'm a little bit confused about how
I want to configure my computer so that say every half an hour it
Can someone point me to a [relatively] simple walk-through on how to properly configure
I am very new to NHibernate, and am little confused on where features should
I have a small problem with Smarty... I have two different template files in
I have classes that are named exactly the same across different plug-ins that I
I have read numerous posts and articles about the element in client endpoints on
I've never used any kind of source control before although I understand the concept.
Hi All I am currently having an issue calling a WCF service from a

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.