to have a product catalog with categories and subcategories you have to create the database correctly:
products:
productID - Primary key column
productName - text
etc...
categories:
categoryID - Primay key Column
categoryName - text
subcategories:
subcategorieID - Primay key Column
subcategoriename - text
prodcategories:
prodcategorieID - Primay key Column
prodcategorieproductID - Foriegn key relation to Product
prodcategorieCategoryID - Foriegn key relation to Category
prodcategorieSubcategoryID - Foriegn key relation to Subcategory
the prodcategories is a linking table used to link products to categories and subcategories