Title: Get data from non-WP DB ?
Last modified: April 21, 2017

---

# Get data from non-WP DB ?

 *  Resolved [Nokaa](https://wordpress.org/support/users/nokaa/)
 * (@nokaa)
 * [9 years ago](https://wordpress.org/support/topic/get-data-from-non-wp-db/)
 * Hi,
 * There’s a basic question : I presume it’s not possible but, I wonder if it was
   possible to get datas from another DB which is not a WP-DB, in order to use thoses
   datas in a WP template ? My company use a back-office which will be difficult
   to migrate (I don’t realy now why they choosed WP, I know that custom post-type
   and WP taxonomies are not the best solutions)…
 * Thank you in advance,
 * Nox

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [9 years ago](https://wordpress.org/support/topic/get-data-from-non-wp-db/#post-9057132)
 * Hi Nox — You presumed wrong 🙂
    Instantiate your own new object from the `wpdb`
   class, passing the appropriate data needed to make a new DB connection. Your 
   object can then use the same methods to interact with the DB as the global $wpdb
   does for the WP DB. Naturally some of the properties like $wpdb->posts will be
   useless, but I believe all the methods do not require a WP DB to work.
 *  Thread Starter [Nokaa](https://wordpress.org/support/users/nokaa/)
 * (@nokaa)
 * [9 years ago](https://wordpress.org/support/topic/get-data-from-non-wp-db/#post-9060387)
 * Thank you, I’ll make some research on it 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Get data from non-WP DB ?’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [Nokaa](https://wordpress.org/support/users/nokaa/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/get-data-from-non-wp-db/#post-9060387)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
