How to access data in wordpress database externally using php

Unless you want to use PHP to run queries directly on your database, you’ll have to use a REST API and Javascript to gather the data. One point worth noting is these REST API’s also use direct database queries in order to gather info to return to you when you make a request. This means that any updates to WordPress database structure that would break your app if you wrote PHP to access the DB would also break the API plugin you use. The only difference is most plugin devs are pretty quick as far as updates go when their code becomes deprecated, and may be able to fix any issues faster than you could.

Here’s one JSON API plugin I found in the WordPress repo: http://wordpress.org/plugins/json-api/

I’m sure there are others. Just look around. Let me know if this helps clarify things a bit.