I have two tables created in mysql database as follows:
category: id, name, description
links: id, cat_id, link_name, link
What I am trying to do is display the data as follows in an html table:
category.name
link_name
link_name
* link_name
category.name
link_name
link_name
* link_name
and so on, depending on how many links there are for each category. Can anyone suggest how can I go about achieving this.
I've tried using two queries, one that selects all info from the category table, and another that selects all info from the link table. After that I setup an outer and an inner loop that will print the category and the links respectively. I didn't get anywhere with it. So if anyone has a simpler way of achieving this, I would appreciate the help.