ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How can I use the Database Class to connect to a different Database?

November 24, 2008 2:32am

Subscribe [2]
  • #1 / Nov 24, 2008 2:32am

    jeffc

    30 posts

    I’ve been searching for over an hour trying to find a post that outlined this but I cannot find it again. Does anyone know what I need to do? I’ve got a function in a file I include in a template to query a separate database and display the results. I swear I found a post showing how I could use the database class to connect to another database. If I’m completely mistaken, is there any downside to just connecting via my own PHP connection?

  • #2 / Dec 15, 2008 4:58pm

    hofboone

    12 posts

    Did you ever resolve this?

    I connect to my own database HOWEVER, the template breaks most of the time because it doesn’t seem to like me doing that. I get a 1146 error. EE is looking to my OTHER database for the tables it needs to perform it’s functions in the EE tags.

    I’m not sure if I need to close my own DB connection more securely, or do something else.

  • #3 / Dec 15, 2008 5:12pm

    jeffc

    30 posts

    No I didn’t.  I know a while ago I came across a post that someone wrote where they extended the EE db class to have two concurrent connections but I’ve been unable to find that post. I ended up just using one database but I still would like to separate it into two.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases