Managing Hierarchical Data in MySQL

By Mike Hillyer (Technical Writer for MySQL AB and lives in Alberta, Canada.)

Source: http://www.mysql.com

2 Comments

  1. Dharmesh said,

    September 30, 2011 at 6:29 am

    Hey you are brilliant in SQL query.. thanks for helping me for select parent category and child category which is inside the parent category..

    Again thanks,

  2. September 23, 2012 at 12:25 am

    I was using nested sets but found that is there was an error, it was very difficult to fix the data. Apparently there is a class in the Zend framework that handles error correction but I have yet to use it.

    Adjacency sets are definitely easier to deal with but there is a hit on performance. It is not an issue if you only have a few hundred nodes however.

    I wrote a PHP class for managing adjacency classes. You can download it here:

    http://www.pdvictor.com/?sv=&category=just+code&title=adjacency+model


Leave a comment