• Resolved kork1010

    (@kork1010)


    I would occasionally like to have access to a seperate product database (MySQL) that resides as a different MySQL database than my WordPress DB. To be honest, I’m not too familiar with WordPress, but I am proficient in PHP/MySQL, so….

    1) Is it possible to interact with a database that isn’t the WordPress database, from within my wordpress blog? (ie. make a 2nd DB connection within WordPress)

    2) If so, how can it be done?

    Thanks for any help and guidance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • It depends on the purpose why you want to use another database.. but yes, you can create another configuration file, or make a connection in wp-config.php itself.. No issue at all.

    Thread Starter kork1010

    (@kork1010)

    Thanks… my main purpose would be to query another database with say the “post_title” to see if a certain product exists in a product database that is mentioned in the post’s title. Or create some sort of [bb code] for things I want to query against that database to see if a match exists, and use conditionals to output things. Sound more than doable? Thanks so much.

    Thread Starter kork1010

    (@kork1010)

    MichaelH.. thanks for the link, but their implementation (accessing WordPress database from an outside script) is different than what I am trying to acheive (access a non-WP database from within WordPress). I would very much like to use WordPress for this project I am working on, however, I just don’t understand what its flexibility is in terms of interacting with other non-WP databases.

    Too bad. I thought maybe flaminglogos’ “Access tables in a different DB” would help.

    Thread Starter kork1010

    (@kork1010)

    Oh wow, I’m sorry Michael.. I didn’t read the thread the whole way to the end. I followed a couple of those links in that thread you posted and since they only talked about accessing WP database from other scripts or just adding tables to the WP database, I assumed the rest of the discussion was inline with that.

    I’m very sorry. I reread the thread at the end and see exactly what you were trying to point out to me. I apologize for my lack of not reading it thoroughly. Thank you so much for finding this for me. I still have some testing to do to see if I can make this work, but I feel you’ve put me on the right track!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Is Another DB connection possible?’ is closed to new replies.