Hi
currently trying to fighure out how i would need to solve this task...
I have a database table which has lots of records and each record will have a parent id attached...
e.g.
Table_1
-----------------------------------
id name parent
1 test1 4
2 test2 3
3 test3
4 test4 2
5 test5 1
6 test6
7 test7 4
8 test8 5
What i want to do in php is when i am given an id e.g. 4 then i want to get all the ids from the db that are childrens of 4.
it could be 0 to many....
so result in this case should be
1, 7, 5, 8
because 1 is child of 4, 7 is child of 4, 5 is child of 1, 8 is child of 5
so how would i construct this array?
this table is in mysql table...
i just want to create an array which stores all the ids of the childrens
any help is much appreciated
Thanks