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? 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. Link to comment https://forums.phpfreaks.com/topic/198894-mysql-creating-categories/#findComment-1044196 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.