Solved

Accessing a WordPress Database from a mobile app

Posted on 2017-01-02
6
102 Views
Last Modified: 2017-01-03
I have a WordPress website with custom tables that I store data into that was entered by customers. The site owner wants to develop a barcode app that can  access this data.  When I need the data from these fields to display within the site,  I request it from a PHP script running on the server that make calls like
get_post_meta()

Open in new window

The owner has hired a mobile app consultant who believes that, if he just has the password to the account where the site is hosted,  he can access all of these database fields from the app.

 I'm not seeing how this is possible. My understanding is that a mobile app can only access a site by making HTTP requests to it. It has no way of running on the server and executing things  like
get_post_meta()

Open in new window

  Am I missing something?

Thanks
0
Comment
Question by:steva
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 3

Expert Comment

by:Edward Jimenez
ID: 41945376
Hi Steve,

If the mobile app consultant has credentials to login to where the actual site is hosted, it is possible to get the requested information directlly from the database, by passing WordPress.

Another solution to create a mobile app with WordPress is using a software called phoneGap.  it will take your WordPress site and create a mobile app both for Andriod and Ios.
0
 

Author Comment

by:steva
ID: 41945416
Thanks for responding, Edward.  The consultant does have credentials to log into to site server, but could you explain how they would then read, for example,  values stored in the wp_2_postmeta table?  I do it with my code that runs in the server by calling WordPress' get_post_meta().  How is an app that comes in on HTTP going to do that?
0
 
LVL 3

Accepted Solution

by:
Edward Jimenez earned 500 total points
ID: 41946177
Hi Steva,

The app can read values using standard SQL query statements, something like this:

select * from wp_2_postmeta;

Now, I'm not saying this is what the approach the consultant will take, but this is just to show that it is possible to get those values.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:steva
ID: 41946230
Thanks.  On a different subject, since you seem to have some experience with mobile apps, and I'm talking to you, you mentioned phoneGap that will create Android and IOS apps from a WordPress site.  I've been looking for software that is  to mobile apps what Wix and Weebly are to HTML.  I just want a simple mobile app that will scan a barcode and pass the number to my site with an HTTP request, but I don't want to learn Android and IOS app development to write it.  It seems there should be something out there to let me drag and drop my way to a simple app like that.  Do you know of anything?

Thanks.
0
 
LVL 3

Expert Comment

by:Edward Jimenez
ID: 41946278
Hi Steva,

To get the barcode scanner functionality, I would recommend a plugin.  Here is one, but it has not been updated for 2 years:
https://codecanyon.net/item/order-barcodes-for-woocommerce/9745632?s_rank=3

You'll have to search around for a plugin that works for you.  

As for the mobile app, there are few changes that you have to make to your WordPress site or any web site for the phoneGap platform to be able to convert it to a mobile app.  Here is the phoneGap site that you want:

https://build.phonegap.com/

and here are the steps:
https://premium.wpmudev.org/blog/creating-a-mobile-app-for-your-wordpress-site-a-diy-guide/
0
 

Author Closing Comment

by:steva
ID: 41946410
Thanks for all the information!
1

Featured Post

Threat Trends for MSPs to Watch

See the findings.
Despite its humble beginnings, phishing has come a long way since those first crudely constructed emails. Today, phishing sites can appear and disappear in the length of a coffee break, and it takes more than a little know-how to keep your clients secure.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ensuring effective and secure communication in the age of healthcare BYOD.
A professional opinion on which Apple product to buy, and a tidbit about the WWDC.
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question