How to use MySQL data in Ionic

Im building a To-Do-List app with Ionic 3. This app should have an authentication, a list of to do list, u can sort by category (sport, university, work). And in this to do list in the To-do-list-list, you can add objectives like “washing clothes”, “…”.

We get the data from the database, with using PHP, but we didnt know how to use, this data out of the database in the ionic app.

Your PHP app should offer an API via HTTP that your Ionic app then uses.

There is a proyect that does what you need. But take on consideration that it handles CRUD operations. You might want to adapt it so you can run custom queries without degrading performance (such as JOINs).

  1. Create a PHP file on the server
  2. Fetch data from the database and simply echo the data in JSON format
  3. Now in your Ionic app, request the data using angular http.get(‘your php file url’)