0

Have a table with three columns: id, parent, name

Any ideas how I get get all the children and subchildren of a specific id?

For example if the rows are like this:

1,NULL,A
2,1,B
3,1,C
4,2,D
5,3,E
6,4,F

The number of parent-child levels can potentially be endless (it's almost always 2-4 levels).

Database is a MySQL database.

Thanks.

Gordon Linoff
  • 1,198,228
  • 53
  • 572
  • 709
Louisa
  • 542
  • 1
  • 8
  • 22
  • Thanks. This one is perfect: http://stackoverflow.com/questions/20215744/how-to-create-a-mysql-hierarchical-recursive-query – Louisa May 30 '16 at 02:27
  • Answer here: http://stackoverflow.com/questions/20215744/how-to-create-a-mysql-hierarchical-recursive-query Thanks Solarflare and mo2 – Louisa May 30 '16 at 02:28

0 Answers0