Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #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

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.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 04:51 PM.

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