Hi
I really hope someone can help me with this. I'm struggling with it for nearly two days now...
I have a DB-table "Device" and a table "Connection". I'm using it to visualize my company's network. To pass the data to the JS-framework I use to visualize the data I need an array like this:
Array
(
[id] => 1
[name] => TestPC1
[children] => Array
(
[0] => Array
(
[id] => 2
[name] => Testhub 2
[data] => Array
(
)
[children] => Array
(
[0] => Array
(
[id] => 3
[name] => Rack3
[data] => Array
(
)
[children] => Array
(
)
)
[1] => Array
(
[id] => 4
[name] => Rack4
[data] => Array
(
)
[children] => Array
(
)
)
)
)
)
)
The device-table looks like this:
A | B
-------------------
1 | 2
2 | 3
2 | 4
The visualization of this example looks like this:
http://img34.imageshack.us/img34/4230/netmd.jpg
Does anyone have an idea, how to get from the db-data to this array?
Thank you.