Dynamic Menu Help

They have: 4 posts

Joined: Apr 2003

I'm setting up a database with entries that have 2 main category types. Let's say they're manufacturer, and product type, 10 categories of each type. That makes 100 possible combinations. Each possible combination has a # of entries underneath it. However, each possibility may not be valid, i.e. Sony and Panasonic both make DVD players, but only Sony makes a game console.

What I'd like to do is to have someone find entries by initially picking an option from one of the 2 menus. Let's say they're searching for playstation 2. Keeping on this example theme. If they pick Sony under the manufacturer menu, it'll pop up a new menu of only the valid listings from the product type menu, i.e. game systems and dvd players, but not sodas.

Of course, they have the option to do this by picking game system under the product type menu, which then would pop up only Sony, Nintendo, and Microsoft and not Panasonic under the manufacturer menu.

Here's the question: What's the easiest way of doing this? I'm thinking of having a big table, where the id numbers of table 1 are columns, and the id numbers of table 2 are rows, with entries in common would be set to true. That way, a simple SELECT would deliver only the valid choices for the dynamic menu. However, I hope there's a better way of doing this.

Another way I was thinking of doing this was to have each category entry hold references to the other category list that are valid selections. Same to the user, different way of doing it.

For a great example of this, check out newegg.com, where you can search for items by category or brand.

ATM I have each category type in its own table, each table consisting of an id # unique only to that category type, and the name of the listing. i.e. under Manufacturer table would be [1, Sony] [2, Panasonic] etc. Under product type table would be [1, gaming system] [2, dvd player] etc. Playstation 2 would be under manufacturer_id = 1, product_id = 1.

Any suggestions?

For a more precise explanation, check this post out: http://www.webdesignforums.net/showthread.php?s=&threadid=6651

Admin at houseofhelp.com
Mod at addaboy.com