NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP and MySQL projects to include in a portfolio.

Richard Harding rharding at mitechie.com
Sat Sep 9 08:33:59 EDT 2006


Tim Gales wrote:
> LK wrote:
>> Neil,
>>
>> I happen to be struggling now with a database issue that might interest you and
>> I'd welcome and appreciate suggestions from the group.
>>
>> My issue is: With a relational database how do you represent and navigate a
>> tree with unlimited number of levels and branches ? Example: categorization
>> hierarchy. Let's say you have a table of Employees. Now you want to categorize
>> them by Job_Type: clerk, secretary, manager, etc. But each one of these can be
>> further sub-categorized, e.g. Manager: production, purchasing, accounting etc.
>> Each one of those can also be sub-categorized in an unlimited recursive
>> fashion. 
>>
>> One could try constructing a table with columns: level_0 level_1 level_2 etc.
>> where level_0 holds the 0-th level categories, level_1 - first level
>> subcategories, etc. But what if the number of category levels is potentially
>> unlimited - what do you do then?
>>
>> Seems like this must have been dealt with before somewhere, and any suggestions
>> and pointers would be greatly appreciated.
>>
>> Leo Kokin

http://www.sitepoint.com/article/hierarchical-data-database

I bookmarked that a while back and I think it will discuss what you're 
looking for.

Rick



More information about the talk mailing list