Jump to content

s8design

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

s8design's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This is tearing my hair out! I've got a page called add.php which contains a form. On the form there is a series of dynamically created checkboxes, the values and labels of which come from the db. The number of checkboxes is not finite as they are generated using a do-while loop in using dreamweaver. The number of boxes depends on the number of rows in the table "features" in the database. This features table contains 2 columns - 'fea_id' and 'feature' where the fea_id is an integer and the feature is text. The Challenge: I want to submit the form and have only the ticked boxes' values added to a table called "join_features" which has 2 columns: 'product_id' and 'fea_id'. If the 1st, 4th and 7th feature were ticked and submitted then the join_features table would look like this: 1 1,1 4, 1 7. The '1' represents the product number so this would display product #1 having 1st, 4th and 7th feature related to it. The Question: Do i need a foreach loop somewhere to cycle through the posted values and add them into the join table? What would the code look like? Please bear in mind that the product number would equal the number of rows in another table called "products" + 1, which would have to be calculated as well. Many thanks in advance + i can provide the code i have if necessary... Dazza
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.