Posted 11 December 2009 - 01:17 PM
That's what it looks like you are trying to do. And I actually misspoke; you should have separate tables for each type of option. For example:
When I create the query page, I first build a drop down menu containing names of the base unit (or a list of check-boxes, radio buttons, whatever). Then I create a drop down menu that contains the available colors by querying the database and getting all the available colors. Then I create a list of materials by querying the database for all of those. When the customer submits their request for a quote, the query then looks something like this:
SELECT base_unit.price, color.price, material.price FROM base_unit, color,material WHERE base_unit.name = 'foo' AND color = 'red' AND material = 'pleather'
Realistically, you would be wanting to use ajax to query your data source to pull back a price as each option is selected so that your clients have a running total on the screen. Once the customer finalizes the selection, send the entire options list back to the database so that the price can be calculated. NEVER put the price in the string that goes from the order form to the server. If I were naughty, I could build a false form request and make the amount say whatever I wanted it to say. What I could not do is get into the database to alter prices. Does that make sense?
Now, if certain options are only available on certain models, then you need to alter your database to hold information regarding which options go with which chairs.