I have mysql table as following.
category
title
link
and I wish to loop them sorted by category and then title asc. Is it possible to echo the category field only once and gather title and link under it?
I guess I could do a loop for each category by sorting each in their own sql-query like: "SELECT category, title, link from TABLE order by category asc, title ASC WHERE category =bananas" but is there a more elegant way of doing it without splitting categories in different sql-queries?
category
title
link
and I wish to loop them sorted by category and then title asc. Is it possible to echo the category field only once and gather title and link under it?
I guess I could do a loop for each category by sorting each in their own sql-query like: "SELECT category, title, link from TABLE order by category asc, title ASC WHERE category =bananas" but is there a more elegant way of doing it without splitting categories in different sql-queries?
Comment