Hi there i have a tree structure navigation for a web site i am building, each page has an id, a parent_id and name. i am looking for a way given one name that i can get the tree to the root page.
a simple excample will help me explane better.
page table
id | parent_id | name
1 0 home
2 0 about
3 2 site
4 2 company
5 4 location
so now if i had the name location i want to use a query that would return 4, 2, 0 which would represent the tree to that node
thanks in advance for any help
a simple excample will help me explane better.
page table
id | parent_id | name
1 0 home
2 0 about
3 2 site
4 2 company
5 4 location
so now if i had the name location i want to use a query that would return 4, 2, 0 which would represent the tree to that node
thanks in advance for any help