In this post by babaloui in February this year, you suggested a solution to select category and subcategories. I have a similar question, but I have two MySQL tables, for example:
"SELECT id, category, sub_id, subcategory, cat_id FROM products,sub_products";
The two tables look something like:
id category sub_id subcategory cat_id
1 house 10 bird 2
2 animal 20 cat 2
30 dog 2
40 fence 1
50 gate 1
60 horse 2
and so on.
What is the difference between using one table and using two tables. I have seen a number of solutions requiring the category and sub-categories to be entered as options within the PHP code, but this is impractical as I could use up to 100 categorys and 1000 subcategories.
I only want the user to select one category from a drop list and display the matching sub-category drop list. for example:
Category ......... house ........ animal
SubCategory ... gate ... dog
... fence ... cat
... roof ... bird
... steps ... horse
Is it possible to do this with PHP using MySQL tables within plain HTML?
Thanks for any assistance you can give me.