I currently have two tables in a database. One for products and one for product options. My product table allows a product to have 4 different option for example size and color etc. My options table gives each option an option ID. So for the option color - red, green, blue and yellow will all have the same option ID but there own record within the table. Where as for size - 34 inches, 36 inches and 38 inches will all have the same product ID and there own record. Then in the products table each product will have up to 4 option ID's.

I want to display the options for a given product in 1-4 dropdown menus for each product if the Product ID is entered.

  1. Work out the Option ID's for the record with the pre-set Product ID

  2. Work out the values for each Option ID from the Option table

  3. Display each set of options in 1-4 dropdown menus

  4. If the Option ID in the product table is 0 then do not display a dropdown for that option

I know this is a big ask but if anyone has a method of doing something like this I would really appreciate your help, as I am bewildered and everything I have tried has failed.

Thanks alot Jon

Member Avatar

I am bewildered ...

Well sorry to say Jon, but your description has had the same effect on me. Could you show your schema and give examples of datarows.

If it's like what I'm thinking then I can see why this would be particularly tricky.