Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #11 (permalink)  
Old August 1st, 2004, 02:44 AM
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




Similar Threads
Thread Thread Starter Forum Replies Last Post
Multilevel subtotal of columns yogeshyl SQL Language 1 July 15th, 2008 02:12 PM
Multilevel Grouping with XSLT 2.0 rzegwaard XSLT 2 January 9th, 2008 04:13 PM
Multilevel unlimited subcategory ? atul PHP Databases 0 September 22nd, 2007 12:37 AM
begin php & mysql - chapter 12, user_form.php jon_stubber Beginning PHP 1 March 9th, 2006 10:57 AM
Error: movie.php & commit.php on p182-186, ch6 willburke BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 October 12th, 2004 02:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.