Solved

Accessing a WordPress Database from a mobile app

Posted on 2017-01-02
6
76 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
  • 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Ensuring effective and secure communication in the age of healthcare BYOD.
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…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…

789 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