Web Analytics Made Easy -
StatCounter Relational Databse Insert Query, Foreach statement. - CodingForum

Announcement

Collapse
No announcement yet.

Relational Databse Insert Query, Foreach statement.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Relational Databse Insert Query, Foreach statement.

    I have 3 tables. Garment. Colors. and Garment/Color. I am trying to make a page where I can add a garment and also choose it's colors at the same time. I have done this several times. This time it's more complicated because the Garment/Color table has many fields, some for sizes and some for additional cost for those sizes. This way, my products can be really accurately added to my database because some product/color combos don't comer in certain sizes or cost more.

    How do I do this logically?

    I have a query that adds the info to the Garment table. but I can't figure out how to add a row for each color option chosen as well as the various fields for each color/garment combo. I think it must be some kind of foreach statement????

    You can look at this to help visualize the problem.

    www.vectortees.com/admin/addgarment.php
    Thanks in advance
Working...
X