1
Hello someone can help me how to create a list with php this type of array. The data comes from two tables, Categories and Products.
I am using Mysql to fetch data from both tables.
My tables:
Categories => id, name
Products => id, id_categoria, name, value
[
{
"id": "1",
"nome": "Pizzas",
"lista": [
{
"NOME": "Pizza Pequena",
"VALOR": "30"
},
{
"NOME": "Pizza Media",
"VALOR": "30"
}
]
},
{
"id": "2",
"nome": "Bebidas",
"lista": [
{
"NOME": "Refri",
"VALOR": "3"
},
{
"NOME": "Suco",
"VALOR": "2"
}
]
}
]
I’ve tried harder I can only list the categories.



You’re not getting the values inside "list"?
– Sam
I actually create the list, I need to display it that way on the web. but I can’t, because it is a means q an api, for me to recover via Axios in React Native
– Camila F
Ixi, then you will have to put in question the codes you are using, the query, the table structure etc. so you can know how to mount the json.
– Sam
You have to inform tb what type of database you are using (if it is Mysql) and the language (if it is PHP)
– Sam
adjusted my question,.
– Camila F
I just think the average pizza should cost more than the small pizza, but... P
– Sam
rsrs, also. Thanks for the help!
– Camila F