How I can create list category from API that use inner join MySQL?

Hi I’m newbie in ionic. So ,my issue is when I click education category which is bachelor , I want to display all courses and universities under that category. I don’t know how to do that in ionic. Hope someone can help me for this problem.

I created API that include inner join for MySQL database to combine 3 tables which are category, university and courses.

Right now , when I click degree education category, it just display only degree.


You didn’t mention which companion framework you’re using. Since I’m most familiar with Angular, I’d like to recommend you take a look at the Tour of Heroes. It covers a problem domain that sounds fairly similar to yours, and will give you a good grounding on this sort of architecture.

I use Angular Framework. but I 'm not sure how to call data from API which use inner join MySQL.

Frankly, when you put it that way, the answer has to be “you don’t”.

Yes, there are lots of threads on these forums full of people asking “how do I make queries from my Ionic app to a MySQL database?”. There are probably many blog posts out there addressing the same topic. Please, don’t go searching for them. There are two enormous reasons why this is a bad idea.

One is structural. The term “spaghetti code” describes designs that blur the lines of responsibility between parts of a program. I prefer the term “house of cards”. As anybody who has ever tried to build one knows, the larger they get, the more apt to fall over they become. It’s really hard to know where one can safely add new cards. Somebody opens a door, there is even a small gust of wind, and down goes the whole thing. When you connect your frontend interface directly to a database, you create a house of cards.

The other reason is security. Obviously, you don’t want any rando with a copy of your app binary to be able to futz around in the internals of your database. However, that’s what you end up opening yourself to when you embed the necessary access credentials into an Ionic app.

Your best option is to create a middleware server process that interacts with the Ionic app via HTTP and with the database in a secure environment. This is the architecture described in the Tour of Heroes. The MySQL joins happen in the middleware, which is completely isolated from the Ionic app. The Ionic app only deals with sending and receiving JSON to REST endpoints on the server.