Jump to content

Archived

This topic is now archived and is closed to further replies.

jwwceo

Tricky foreach statement...

Recommended Posts

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... [url=http://www.vectortees.com/admin/addgarment.php]www.vectortees.com/admin/addgarment.php[/url]

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...

Share this post


Link to post
Share on other sites

×

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.