Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Accessing a WordPress Database from a mobile app

Posted on 2017-01-02
Medium Priority
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

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

Open in new window

  Am I missing something?

Question by:steva
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

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.

Author Comment

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?

Accepted Solution

Edward Jimenez earned 2000 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.
Cyber Threats to Small Businesses (Part 1)

This past May, Webroot surveyed more than 600 IT decision-makers at medium-sized companies to see how these small businesses perceived new threats facing their organizations.  Read what Webroot CISO, Gary Hayslip, has to say about the survey in part 1 of this 2-part blog series.


Author Comment

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?


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:

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:


and here are the steps:

Author Closing Comment

ID: 41946410
Thanks for all the information!

Featured Post

2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

Question has a verified solution.

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

With the rapid rise in mobile usage, mobile devices are here to stay and have become an integral part of doing business. Here are 9 great apps for your BYOD environment.
Ransomware, the malware that locks down its victim’s files until they pay up, has always been a frustrating issue to deal with. However, a recent mobile ransomware will make the issue a little more personal… by sharing the victim’s mobile browsing h…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
This video teaches users how to migrate an existing Wordpress website to a new domain.

618 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