Hi,

I have written a little  tree handling code on cake (without 
findAllThreaded).
https://cakeforge.org/plugins/scmsvn/viewcvs.php/trunk/cameleon/?root=cameleon

In the model there is a function get_childnodes($id = "") that does what 
you need.
https://cakeforge.org/plugins/scmsvn/viewcvs.php/trunk/cameleon/models/category.php?rev=11&root=cameleon&view=markup

Olivvv

TimO wrote:
> Hey,
> I have made a query where i want to select a parent and its childs.
> I want the array to be like the normal cake structure
>
> [PARENT]
> infomation
> ---------------[CHILDS]
> -------------------------[0] information
> -------------------------[1] information
> -------------------------[2] information
>
> Im to big of a sql writer. I came up with this:
>
> SELECT * FROM content_table AS Content ,content_table AS Childs WHERE
> Content.id = Childs.parent_id AND Content.id = '$id' ORDER BY
> Content.position,Childs.position,Content.name,Childs.name
>
> I know about the findAllthreaded function but it has limited selecting
> capability.
> The findAllThreaded method can't begin somewhere in the middle of the
> tree and find the childs from that level or id.
>
> My query returns another sort of array. Every child gets retrieved and
> has a parent information array in the row. When the parent has no
> childs nothing gets returned but i need the parent information
> nevertheless.
>
> Can somebody send me in the right direction with this problem?
> thanx Tim
>
>
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to