Can You Use MySQL as a Data Store for a Mobile App?

Soldato
Joined
24 Sep 2007
Posts
4,917
Hi Guys

Can You Use MySQL as the Data Store for a Mobile App?

I'm thinking of creating my first mobile app and just wondered if this was possible.

Thanks
 
Soldato
Joined
16 Jun 2013
Posts
5,375
Yeah it can. Most likely using the same php scripts in place already.

Only thing without knowing what you're doing/how it's built we can't say for sure.

I had completely forgotten about SQLite. I'm not sure if it's still the case but unless it's a static database every data change/update would require a new update for the app. It wasn't ideal in many situations.
 
Soldato
OP
Joined
24 Sep 2007
Posts
4,917
I just need the mobile app to retrieve data from the MySQL database. I know how to do this for websites, but I've never tried a mobile app, and was wondering how different it was.

Rgds
 
Soldato
Joined
28 Oct 2006
Posts
12,456
Location
Sufferlandria
I just need the mobile app to retrieve data from the MySQL database. I know how to do this for websites, but I've never tried a mobile app, and was wondering how different it was.

Rgds

Most hosts wont allow external access directly to the database. You'll probably need to do it through a web service or something running on your website.
They might set it up for you if you ask though?
 
Soldato
Joined
16 Jun 2013
Posts
5,375
I use JSON to php for my mobile app connections. Or if that would require you mucking around with current website phps you could use httprequests just as easily.

Still depends on how the site is set up.

Edit: I thought direct access to DBs was a big no no :confused:.
 
Last edited:
Associate
Joined
21 May 2013
Posts
1,991
Direct access to the DB is a bad idea. You would need to create some intermediary service to act as the bridge between the DB and the mobile app. A common one is a JSON-based REST API. The app queries the web service, which in turn fetches the requested data from the database (after checking it's allowed!!).
 
Caporegime
Joined
18 Oct 2002
Posts
29,491
Location
Back in East London
There's a bit of conflation going on here.

What are you looking to store? If it's just stuff like the app's preferences, then no, you don't want to be connecting over the wire to a remote DB.

If it's stuff that will be accessed on different devices and should be the "same" data, then yes you'll want a remote DB.
 
Back
Top Bottom