I did a table with categories in a products table then i figured our i should move the categories off into another table .. now I need to add subcategories ...
I read a bit .. and found someone doing this :
CATEGORY TABLE
-----------------------
CREATE TABLE CATEGORY(
cat_name char(50),
cat_id int4,
PRIMARY KEY(cat_id));
-----------------------
SUB_CATEGORY
---------------------------
CREATE TABLE SUB_CATEGORY(
subcat_name char(50),
subcat_id int4,
PRIMARY KEY(subcat_id));
---------------------------
SUB_SUB_CATEGORY
-------------------------------
CREATE TABLE SUB_SUB_CATEGORY(
sub_subcat_name char(50),
sub_subcat_id int4,
PRIMARY KEY(sub_subcat_id));
------------------------------
SUB_CATEGORY_LOOKUP_TABLE
----------------------------------
CREATE TABLE CATEGORY_LOOKUP_TABLE(
look_cat_id int4,
look_subcat_id int4,
look_sub_subcat_id int4,
PRIMARY KEY(look_cat_id,look_subcat_id,look_sub_subcat_id));
How can i use the lookup table? is this function supported by MySQL? It's empty although i added data to the categories and subcats...
please help