Hi guys, this is weird because i know how to extract the information i need. But i know theres a more effcient way of doing it. So id like your input!
consider this list of results from DB
Thats needs to look like this
And heres the array with the results
Array
(
[0] => Array
(
[id] => 1
[product] => kings puzzle
[category] => childrens puzzles
[group] => puzzels
)
[1] => Array
(
[id] => 1
[product] => kings puzzle
[category] => 250 pieces
[group] => puzzels
)
[2] => Array
(
[id] => 5
[product] => window wars
[category] => 250 pieces
[group] => puzzels
)
[3] => Array
(
[id] => 7
[product] => hershual
[category] => 500 pieces
[group] => puzzels
)
[4] => Array
(
[id] => 2
[product] => queens puzzle
[category] => 1000 pieces
[group] => puzzels
)
[5] => Array
(
[id] => 1
[product] => kings puzzle
[category] => multibox packs
[group] => puzzels
)
)
Group and Category are unique whereas Products are allowed to repeat
So whats your way of structuring the results as my image suggests?