WordPress.org

Support

Support » Plugins and Hacks » Multiple wpdb classes

Multiple wpdb classes

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

  • The topic ‘Multiple wpdb classes’ is closed to new replies.