I currently have a table structure like this
create table main(id int(10) unsigned NOT NULL AUTO_INCREMENT, fname varchar(25) NOT NULL DEFAULT '', `uid` int(10) unsigned NOT NULL, PRIMARY KEY (`id`))
insert into main(1, 'abcd', 1), (2,'doll',1), (3,'animals',1)
CREATE TABLE category (
`cid` int(3) NOT NULL AUTO_INCREMENT,
`id` int(2) NOT NULL DEFAULT '0',
`category` varchar(25) NOT NULL DEFAULT '',
PRIMARY KEY (`cid`)
)
insert into category(1,1,'abcd1'), (2,2,'doll1')
Table category is related to table main. main=>category
I need 3 level nesting
main=>category=>subcat1=>subcat2
How do i modify the table structure?
Thanks