vaid
vaid

Reputation: 1540

Communicating with a Wordpress database

This question is a bit wider than accepted on SO, but I need to start somewhere as I am a bit new to some things.

I am developing an iOS/Android app for a client who has an online store based on Wordpress.

Inside the app, the user logs in using their user credentials that he/she has created on the online store, where the underlying login system is handled using webrequests

His WP site has a database called store_locations consisting of longitude and latitude fields, and I need to somehow read the fields from the app.

What I am wondering is:

  1. would I need to create a custom PHP script to access the DB?
  2. How is security handled such as user verification?
  3. Where is the PHP script placed on the server?

NOTE:

Please let's have a discussion in the comments first, as I might need to fine-tune the question as per request if anything is unclear.

EDIT 1 I found the following video https://www.youtube.com/watch?v=f7ID_L91lIk where the instructor at 19:00 to 20:51 talks about what I'm assuming would clarify question 2 from above.

Upvotes: 0

Views: 55

Answers (2)

Franco Sarachu
Franco Sarachu

Reputation: 161

If you are going to interact with Wordpress from an external source you should use WordPress REST API.

You need to fetch data from a custom database table, so take a look at Adding custom endpoints.

Upvotes: 1

trex005
trex005

Reputation: 5115

As you said, this is probably too broad for here. I suggest you create a plugin that gives you ajax access. You can study up on that here and then when you have more specific questions, let us know.

I understand that you asked to discuss it in the comments first, but there is just not enough to discuss here and that is asking quite a lot for an undeveloped plan.

If you have more questions, feel free to comment here.

Upvotes: 0

Related Questions