views:

71

answers:

1

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
+2  A: 

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://dev.mysql.com/tech-resources/articles/hierarchical-data.html

Andy West
@Andy, thanks for the Nested sets link! **Very** useful and pretty slick! :-)
namespaceform