Question

Could anyone explain what node means in MySQL?

This one is talking about nested set.

I am reading a document from Codeigniter's wiki and I am not sure what I am supposed to add for $node.

getSubTreeAsHTML (line 704)

Renders the fields for each node starting at the given node

    * return: Sample HTML render of tree

string getSubTreeAsHTML (array $node, [array $fields = array()])

    * array $node: The node to start with
    * array $fields: The fields to display for each node
Was it helpful?

Solution

The code you are looking at is part of BackendPro. The full code of the function can be viewed here.

"Node" in this case refers to a data node of a nested set. Nested sets are nice because they allow you to quickly select a whole branch of a hierarchy with only the starting node.

It looks like the function specified renders part of a tree in HTML starting at the node you specify. The BackendPro interface must render hierarchical data somewhere.

EDIT: Nested sets are not a MySQL-only concept, but there is a good article about nested sets and MySQL here:

http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top