Thread: MultiLevel PHP
View Single Post
  #11 (permalink)  
Old August 1st, 2004, 02:44 AM
cjp_qld cjp_qld is offline
Registered User
 
Join Date: Aug 2004
Location: , , Australia.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Nikolai,

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:
products sub_products

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.

cjp_qld
Reply With Quote