0
I need to select and leave everything organized according to its category:
An example: https://novaframework.com/documentation/v2.2
My table is like this:
Categories:
Articles:
My query:
$query = "
SELECT
c.*,
a.*,
GROUP_CONCAT(a.title SEPARATOR '|') AS articles
FROM categories c
INNER JOIN articles a ON c.category_id = a.category_id
GROUP BY c.category_id";
With this query above it ends up like this:
I don’t really understand what you want to do, but if you want to select all articles in order of category, just one: SELECT * FROM articles ORDER BY category_id
– boolean
@Joãobolsson, I need to return each article within its id, notice that in Categories, you have, starting, the basics and helpers I will edit the topic with my query
– user148010
Take a look at this topic: https://answall.com/questions/293484/display-products-de-v%C3%A1rias-categorias é o que você precisa
– boolean