Maybe you are looking for to take advantage of findAllThreaded(). If so instead of categoria_id to name the parent field, name it parent_id:
create table categorias ( id int not null auto_increment primary key, description text not null, nivel int, parent_id int ); Check this article out: http://bakery.cakephp.org/articles/view/63 -MI --------------------------------------------------------------------------- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! -----Mensaje original----- De: [email protected] [mailto:[EMAIL PROTECTED] En nombre de Erick Tedeschi Enviado el: Jueves, 14 de Diciembre de 2006 08:58 a.m. Para: Cake PHP Asunto: association for same table I am trying to make an association for the same table, to make registers of categories and sub-categories: I tried the following one: //mysql create table categorias ( id int not null auto_increment primary key, description text not null, nivel int, categoria_id int); when I generate the controller gives error. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---
