Fetch Data from MySQL

Hi there, I’m pretty new to Ionic, and started today to build a web-app that show some Google Maps Markers.

I’ve build up a GPS tracker using Arduino, that post locations on a mySQL DB stored on 000webhost.
Now I would like fetch those data onto my ionic app, in order to display them. No need to post.

Is there any example on how to set it up correctly (doesn’t need to the same as my project of course…)?

Imho the most interesting thing here is how the expose the mysql db to an http interface.

One option could be to make small php backend that does the simple query and returns a json file to the webapp

Another way is to generate json files from a cgi-bin script or cron job and expose via ngnix or apache

Many ways…

How did u want to expose mysql?

Actually my idea was to build a php that queries the necessary (Simply the latest location stored in the db), and then give the result to a google maps Marker.
I’ve already set up the google maps APIs on ionic, my doubt now is, how can I render the coordinates from the query to the ionic app.

What is the difficult part here?

Try to get the data from mysql and then the processing should be easy

So let the front end get stuff from both api points

Well, it’s my first time using Ionic, and I was searching for some examples on that

Plse search this forum on mysql and php

Some people have done that part before and you are likely to find code snippets

Or just google mysql php json