random1 Posted April 18, 2010 Share Posted April 18, 2010 Hey All, I've created a table: CREATE TABLE `product_category` ( `productcategory_id` BIGINT(50) UNSIGNED NOT NULL COMMENT 'The ID of the Product Category', `productcategory_parent_id` BIGINT(50) UNSIGNED NOT NULL COMMENT 'The ID of the Product Category\'s Parent', `productcategry_status_id` BIGINT(50) UNSIGNED NOT NULL COMMENT 'The Status ID of the Product Category', `productcategory_name` VARCHAR(100) NOT NULL COMMENT 'The Name of the Product Category', PRIMARY KEY (`productcategory_id`) ) ENGINE=InnoDB ROW_FORMAT=DEFAULT This table holds the categories that I want to link to my 'product' table. I've looked at: http://www.sqllessons.com/categories.html as a starting point. Is there a standardized structure of handling categories for products, services, items etc? The structure needs to allow for categories having parents and for subcategories. E.g: Food > Fish > Fresh Water Fish ...... Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/198894-mysql-creating-categories/ Share on other sites More sharing options...
fenway Posted April 18, 2010 Share Posted April 18, 2010 The sticky has some great resources on various hierarchical table design considerations. Quote Link to comment https://forums.phpfreaks.com/topic/198894-mysql-creating-categories/#findComment-1044196 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.