Ok, so I need to know how to query my database using php joining together some columns. Table “products” has 3 columns I need, product, category, subcategory. Table"categories" has 2 that I need, category, subcategory.
I would like for table “products” to display all the results for the specified category from “categories”
here is a visual representation
table"products"
product Category Subcategory
T-Shirt retail none
water retail none
uniform retail uniforms
seminar events none
table"categories"
category subcategory
Retail none
retail uniforms
events none
so when it displays, they will display in buttons
there will be two main category buttons: retail and events
then there is one subcategory for retail: uniforms, as the table shows
then there will be the two products that have a category of retail that show under the retail button along with the subcategory. then under the subcategory uniforms, the uniform would show
and under the category of events, seminar would show. so in the categories table, if the subcategory is none, it ignores it, but if the subcategory is not none, then it looks to the category as to where it should be placed. does this make some sense as to what I would like to do?