-2

Possible Duplicate:
PHP / MySQL build tree menu

I need get data between two level build menu.

ID | Parent    | Name    | 
 1 | 0         | Cat1    | 
 2 | 1         | SubCat1 | 
 3 | 0         | Cat2    | 
 4 | 3         | SubCat2 | 
 5 | 4         | SubCat3 | 
 6 | 3         | SubCat4 | 
 7 | 3         | SubCat5 |


Level 1: Cat1 and Cat2
Level 2: SubCat1, SubCat2 and Subcat4
Level 3: SubCat3 and SubCat5
  • Cat1
    • SubCat1
  • Cat2
    • SubCat2
      • SubCat3
      • SubCat5
    • SubCat4

I want to level 2 and level 3 menus list data. How I call between 2,3 row?

0

1 Answer 1

1

The correct name here for this data is an adjacent list hierarchy

There is a guide on this website to produce this in MySQL

http://kod34fr33.wordpress.com/2008/05/06/adjacency-list-tree-on-mysql/

Sign up to request clarification or add additional context in comments.

1 Comment

thank you, but I can not work with trigger.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.