WordPress.org

Support

Support » Plugins and Hacks » Calling external database

Calling external database

  • 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!

Viewing 1 replies (of 1 total)
  • 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.

Viewing 1 replies (of 1 total)
  • The topic ‘Calling external database’ is closed to new replies.
Skip to toolbar