I have same experience, but my data are stored in one table. My table is looks like this:
trees: id, label, parent_id parent_id refering to id as its parent. How to create the model for that situation? Thanks in advance. On 12/27/06, phirschybar <[EMAIL PROTECTED]> wrote:
Are all of the items in your hierarchy one type of data? In other words, are they all in one table with an association of "has and belongs to many"? Ben On Dec 26, 7:32 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have a situation where I know the id of a child, but I need the > parental hierarchy. Using the structure in this (excellent) Bakery > example, I have the following: > > 1. Art > 1. Film > 2. Music > 1. Jazz > 2. Pop > 2. History > 1. Archaeology > 2. War > 3. Science > 1. Biology > 2. Chemistry > 3. Physics > 4. Technology > 1. Computing > 1. Hardware > 2. Software > 2. Engineering > > In my situation, I know of "Hardware", but I need to know the > following: > > 4. Technology > 1. Computing > 1. Hardware > > Or if I know of "Physics", I need to know: > > 3. Science > 3. Physics > > Does anyone know how to accomplish this in a Cake-ish way (without > hacking a bunch of queries together in my controller)? > > Thanks in advance! >
-- Regards, Ananda Putra --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---