I have a mySQL table which has rows of product attributes and each one associated with a particular attribute category (id_attrib_cat).
User is supposed to define a price for each product attribute combination so I need a loop to create an attribute table with a price input at the end of each line.
Attribute category value is important to exclude attributes from same category from being combined.
How can I accomplish this?
EDIT
Example of Attribute categories : Values
Format: square, rounded
Size: S, M, L
Color: white, blue, black, yellow
Example of attribute combination table (loop below should do this):
- Square + S + White = [price input]
- Square + S + Blue = [price input]
- Square + S + Black = [price input]
[...]
$q = mysql_query("SELECT id_attrib_cat, id_attrib, name FROM cms_products_attribs WHERE id_product=10 ORDER BY id_attrib ASC");
while ($row = mysql_fetch_array($q, MYSQL_NUM)) {
[** attribute combination + price input code **]
}