Title: Multiple wpdb classes
Last modified: August 19, 2016

---

# Multiple wpdb classes

 *  [JadedEvan](https://wordpress.org/support/users/jadedevan/)
 * (@jadedevan)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/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.

## Tags

 * [database connection](https://wordpress.org/support/topic-tag/database-connection/)
 * [wordpress-mu](https://wordpress.org/support/topic-tag/wordpress-mu/)
 * [wpdb](https://wordpress.org/support/topic-tag/wpdb/)

 * 0 replies
 * 1 participant
 * Last reply from: [JadedEvan](https://wordpress.org/support/users/jadedevan/)
 * Last activity: [17 years, 2 months ago](https://wordpress.org/support/topic/multiple-wpdb-classes/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
