I have a site that is a mix of WordPress and other PHP pages. Can I query the other database and have the results show within WordPress?
Leave a Reply
You must be logged in to post a comment.
I have a site that is a mix of WordPress and other PHP pages. Can I query the other database and have the results show within WordPress?
You must be logged in to post a comment.
Yes you can since WordPress is written in PHP, and PHP allows you to use whatever database you want.
Late to the party, but if you’re willing to add stuff to the wp-includes/wp-db.php file you can query those other databases using the $wpdb object.
Specifically, you need to add a var:
and add your database name to this: