last day (14 days later) » 

3:40 AM
0
A: Dataset to JSON tree by merging

bytec0deUse an array. var products = new Array(); // using new Array() to avoid mess products = [ [ // Home Needs [ "Refrigerator", "red", "$500", ], [ "VacuumCleaner", "w...

 
Thanks! But the question is how I can transform the dataset to this array/JSON!
 
@Robert You need something that would transform a table of data into an array?
 
Yes! But I dont need as I asked in the question! It means hierarchically. Not as same in the Database! Hope you understand!
 
@Robert Yes I do. Might wanna host an SQL database. PHP can order the query results into an array.
 
I can convert the query results into an array, but here the deal is to convert the normal query results into a tree kind of array. That means the repetitions should not be allowed.,
 
3:40 AM
@Robert Oh. Hierarchy.
Well
You mean
query > array like I posted before ( meaning a "neat" kind of array? )
 
Yes
Want to know if there is any way to change my dataset into a hierarchy
As of now, I have to try something like - check the previous row , if it is same-add the next column as child.
 
Uhuh.
Yes
I see
To be honest that might be a good solution
 

last day (14 days later) »