WordPress.org

Ready to get started?Download WordPress

Forums

Multiple wpdb classes (1 post)

  1. JadedEvan
    Member
    Posted 5 years ago #

    I've got a WordPress MU installation that I need to have share data with a standalone WordPress installation. They are obviously using different MySQL databases. Right now this exists as a plugin in my WPMU installation.

    My approach to the problem was to simply create another instance of the wpdb class which would connect to the other other database. (For reference, the WPMU is the primary, the WordPress wpdb would be the secondary). I was able to set some variables and create the new instance without error.

    When I try to access any query to the new wpdb class it doesn't return any results. It looks like the class was instantiated fine but does not pull back any results. I'm stumped - I'm not sure exactly what I am doing wrong or not doing. Any thoughts?

    WordPress MU has a flag for allowing multiple databases in the wp-config.php, but that looks like it is to spread data among a single installation, not to share data between separate installations.

Topic Closed

This topic has been closed to new replies.

About this Topic