I have a data set that is setup for comments. I have levels and a sort column but now I would like to either get this in an array or display it somehow in a meaningful way:
id comment Parentid Level sortcol
2 Test NULL 0 0x00000002
4 This is the Second NULL 0 0x00000004
5 First Reply 4 1 0x000000040005
7 Reply to first reply 5 2 0x0000000400050007
6 Second Reply 4 1 0x000000040006
8 Reply to second comment 4 1 0x000000040008
How do I get this into an array in PHP or VB.net (I don't have a preference and use both regularly).
I want an array that looks like this (I am just specifying the ids:
array([0]
[id]=>2
[1]
[id]=>4
array([0]
[id]=>5
array([0]
[id]=>7
)
[1]
[id]=>6
[2]
[id]=>8
)
)
The data is a SQL result.