in reply to Parent/Child Association with mySQL statements

The article Managing Hierarchical Data in MySQL might be of interested for you.

The way you store your tree now (by storing the parent ID) means that you have to recurse to retrieve the nesting depth, and that you need to execute one sql statement per level. Other ways of storing the tree (as described in the article above) might work better, but it really depends on what you do with your data, and how often you do it.

  • Comment on Re: Parent/Child Association with mySQL statements