Multi-level menu with database

This is my DB of me. I want design Multi-level menu with database!





CREATE TABLE IF NOT EXISTS `menu` (

  `id` int(255) NOT NULL AUTO_INCREMENT,

  `ten` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

  `vitri_menu` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

  `lien_ket` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

  `thuoc_menu` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

  PRIMARY KEY (`id`)

) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=89 ;




how i do now?

Thanks very much

It would be perfect, if you name fields in your tables using English. I don’t understand what they mean, actually :)

And look here: http://www.yiiframework.com/doc/api/1.1/CMenu

Thank you very much@@

@lonely: are you Vietnamese?

I think you menu with multi-level should be that:

[sql]

create table menu (

`id` int unsigned not null primary key,


`name` varchar(45) not null,


`index` int unsigned not null default 0,


`parent_id` int unsigned,


constrainst foreignkey FK_menu__parent_id (parent_id)


	references `menu` (`id`) on update cascade on delete cascade

) engine=INNODB;

[/sql]

Show, use GII to generate your model, with some small modifications, it will be fine.