Hung Viet
Hung Viet

Reputation: 21

Nested set model build tree from node to JSON object

I am working to build a category hierarchical like this:

Home

- Car
  - Yellow
  - Red
- Animal
  - Cat
     - Node1
     - Node2
  - Dog

I use php & mysql schema with nested set model:

- left
- right
- id

I want to get a tree from a Animal node to result and JSON structure this:

- Animal
  - Cat
     - Node1
     - Node2
  - Dog

I dont have any solution for that. Please help me !

Upvotes: 2

Views: 407

Answers (1)

megadruck
megadruck

Reputation: 437

This post is old , but maybe it helps other. Good article written in german including sql queries. http://www.klempert.de/nested_sets/

Upvotes: 1

Related Questions