Hi

I have a table which is set out like this

ID name parentID

I "select * from table" into $result.

I then wish to walk through the result such that it creates a
multidimensional array sorted with children under parents. Here is a basic
eg.

ID      name    parentID
1       books   0
2       movies  0
3       songs   0
4       horror  1
5       love    1
6       horror  2
7       love    2
8       scifi   2
9       IT      4

etc

I am trying to write a function that would then insert these into a
multidimensional array as such...

$array[1] = "books";
$arary[1][4] = "horror";
$array[1][4][9] = "IT";

etc, so I could pull them out into a select dropdown list nicely sorted.

I am not sure how to write an array function with an unlimited number of
levels. If someone could help out it would be greatly appreciated.

Thanks
Stephen




-- 
PHP Database 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