I want to create an array like this:

$tree = array (
    "first"  => array ("stuff1", "stuff2", "stuff3"),
    "second" => array ("stuff1", "stuff2")

based on tree of information, stored in a database table:

level parent_cat child_cat
1       first           first
1       second  second
2       first           stuff1
2       first           stuff2
2       first           stuff3
2       second          stuff1
2       second          stuff2

That translates to a structure like this:

           first                                second
             |                             |
 |---------|--------|              |-----------|
stuff1  stuff2  stuff3  stuff1  stuff2

Can someone point me towards an SQL example that would help me structure the
query, and an example of how to reference information in it once I have it?
e.g. a while list/each but for a multidimensional array?


PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to