I have this example table data, it actually has ids, prices, more stuff, but i think i can ask with this data, im using PHP as my language:
id category product complement_type option
1 Pizza Large Pizza Bread Brown bread
2 Pizza Small Pizza Bread White bread
3 Pizza Small Pizza Ingredients Olives
4 Salads Green Salad Extras Bacon
5 Salads Cesars Salad Extras Lettuce
i already have the query for this table,
now i want to convert ir to an array of this type
array(
[Pizza] => array(
[Large Pizza] => array(
[Bread] => Brown Bread
)
),
array(
[Small Pizza] => array(
[Bread] => White Bread
[Ingredients] => Olives
),
)
),
[Salads] => array(
[Green Salad] => array(
[Extras] => Bacon
)
[Cesar Salad] => array(
[Extras] => Lettuce
)
)
that array is what i am trying to achieve, but i just cant get it right
i know i have to loop it with a for loop, maybe add a while loop to get the changes in the categories, but i just dont seem to find the way to do it, any ideas on how to achieve this?
i appreciate any idea
Again, im using PHP
thanks
Edit: heres the link to the data im getting, its a little different, but its the same principle