Hi,
Im programming an online shop, but I have a big problem with categories, I
detail the database structure:
Categories:
CAT_ID | CAT_NAME | RELATION
1 | Computers | 0
2 | Notebooks | 1
3 | Tablets | 1
4 | Notebooks IBM | 2
5 | Notebooks HP | 2
PRODUCTS:
PROD_ID | PROD_NAME | CAT_ID
1 | Notebook HP 102 | 5
2 | Notebook HP 103 | 5
Like you can see in the products table I store the ID of a category that
have some relations in its table:
Id 5 - Notebooks HP -> Id 2 Notebooks -> Id 1 Computers
The problem came when I want to show all computers and I g oto the id 1 for
show all and any product have stored this CAT_ID, because all have the last
subcategory id.
Can you help me to know how to do that?
Thanks for all.