Jump to content


Photo

Tricky foreach statement...


  • Please log in to reply
1 reply to this topic

#1 jwwceo

jwwceo
  • Members
  • PipPipPip
  • Advanced Member
  • 212 posts

Posted 27 September 2006 - 11:59 PM

I am building a page for adding a product to a database. The product can come in many many colors. The ADD PRODUCT page has fields at the top of the page which are pretty standard, size, price, etc. At the bottom of the page are a list of colors available. With a checkbox for each color the product comes in. However, there are other features that are unique to each color/product combination. For example there is another set of form fields next to each color..to indicate if the color/product combo comes in certain sizes or if there is an additional cost for each size/color/product combo. Kinda complicated.

you can look at it here... www.vectortees.com/admin/addgarment.php

Anyway, all the data about the colors is in a seperate table that links the product id with the color id as well as all the other info.

I have my main query set up to add the main product info to the product table, but I don't know how to name my form fields so that I can add everything to the product/color table.

I assume all the info, the 2x, 3x,  etc...will all be lised in an array and then some kind of foreach statement...I just can't get the exact syntax...

Any ideas....?? I hope this makes sense...


#2 steveclondon

steveclondon
  • Members
  • PipPipPip
  • Advanced Member
  • 161 posts

Posted 28 September 2006 - 07:30 AM

an example of some code here that you have will be of some help




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users