WordPress.org

Ready to get started?Download WordPress

Forums

Calling external database (2 posts)

  1. Domhnull
    Member
    Posted 9 years ago #

    I'm writing what I thought was a simple plugin but have run into a problem I hope someone can help with. I have dated information stored in another MySQL database. I hooked into the_content filter to call my function. My function takes the_date, uses that to look up information in my other database which will be added to the bottom of the post. The trouble is that doing that seems to break the connection for the WordPress database.

    Is there a way to connect to an external database within a plugin without breaking the connection to the WordPress database?

    Thanks!

  2. Domhnull
    Member
    Posted 9 years ago #

    I think I figured it out. I just needed to call mysql_select_db at the end of my function so that the WordPress db is selected.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.