Solved

Accessing a WordPress Database from a mobile app

Posted on 2017-01-02
6
69 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Word Press Enigima 7 44
WordPress Themes 10 42
Effect of setting a page visibility to Private 3 22
Full width video doesn't shrink on mobile- wordpress, divi 8 47
WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
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!
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

777 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