Sorry in advance for the noob-question.
I've scoured Google and StackOverflow and have found plenty of ways to access wpdb on a php page when you're on the same server, but no one seems to have an answer to calling it from an entirely different server.
I'm trying to create a plugin in Piwik that queries our multi-site WP DB (hosted on a separate server from Piwik) to get the total count of posts. The query is easy when you use the wpdb class (e.g., $wpdb->get_results)... but not so easy if you try to run a straight SQL query since you'd have to tally up a count from 60+ tables, hence my desire to use wpdb to grab all the useful functions.
That being said, using require_once( 'http://www.example.com/wordpress/wp-load.php' ); (h/t to stormmyfrog) to access the wpdb object isn't very secure if you set allow_url_include=1. Is there another way to get around this?