What part didn't work? You have to be more specific or we can't help you. This is all you need to know to create a self-join table, just replace "Post" with your model name in the last example: http://book.cakephp.org/view/1046/Multiple-relations-to-the-same-model
And why not use a more intuitive/descriptive table name? Instead of a table called "c_folders" and a model called "CFolder", just name the table "client_folders" and call the model "ClientFolder". It'll make your code more readable and be less confusing to other people who have to look at your code or who may inherit the application from you. On Jun 14, 5:56 am, Abhishek <[email protected]> wrote: > Hi, > I am in a situation where i need to self-join a table. > > This is the structure of the table .. > > CREATE TABLE IF NOT EXISTS `c_folders` ( > `id` int(5) NOT NULL AUTO_INCREMENT, > `parent_id` int(5) NOT NULL, > `client_id` int(3) NOT NULL, > `name` varchar(100) NOT NULL, > PRIMARY KEY (`id`) > ) ; > > The c_folders table needs to refer itself so that we can create a tree > like structure. What should the model look like in this case. > > I referred to the article below .. but somehow it didnt seem to work > for > me.http://bakery.cakephp.org/articles/view/coding-a-self-join-in-a-cake-... > > Regards > Abhishek Jain Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] 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
