NYCPHP Meetup

NYPHP.org

[nycphp-talk] Building trees

Jim Hendricks(Biz Computing) jim at bizcomputinginc.com
Wed Oct 16 17:37:46 EDT 2002


Yes, I've worked with manufacturing apps, more from the repair 
parts/refurb/warranty repair side.
The database we were working with back then wasn't SQL though it was 
relational.  This allowed
for some interesting permutations you can't do in SQL for trees.

Jim

Tim Sailer wrote:

>On Wed, Oct 16, 2002 at 04:16:36PM -0400, Jim Hendricks wrote:
>  
>
>>That's what I'm doing now, but in order to build the whole tree requires 
>>multiple queries with this design. My latest idea is to add a tierlevel 
>>field so I won't have to issue a query for parentID = 0 ( top level ) 
>>then iterate this result & generate a query for parentID = the id of the 
>>row we are on in top level etc. right on down the line.  If I have 4 top 
>>level projects each with 3 sub projects and 1 of the subprojects have 2 
>>subprojects this would require issuing 1 toplevel query, 4 2nd level 
>>queries,  12 3rd level queries, and 2 4th level queries.  All told for 
>>this simple tree I will have issued 19 queries.  If I have a tierlevel 
>>    
>>
>
>Those of you (if any) from a manufacturing background will see this as
>the way a Bill of Materials (BOM) is built for a product. A product is
>built from subassemblies, which are built from either other subs or
>individual components (greatly simplified). This is a tried and tested
>way of building trees.
>
>Tim
>
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20021016/abfa062b/attachment.html>


More information about the talk mailing list