Search the Community
Showing results for tags 'dropdown'.
Hi everyone, I'm building my own shopping website. I haven't figured out how to populate two dropdown lists with available sizes and colors of a product_id from database. Here is the result I've got from querying database. id product_name style size color price image sku stock 1 Neck Top 104 S White $30.00 104.jpg 104-1 5 2 Neck Top 104 S Black $30.00 104.jpg 104-2 5 3 Neck Top 104 M Red $30.00 104.jpg 104-3 10 4 Neck Top 104 L Blue $30.00 104.jpg 104-4 10 5 Neck Top 104 XL Black $30.00 104.jpg 104-5 5 And here are my tables: tblProduct tblSizes tblColors tblSpecific_Products id id id id product_name size color product_id style size_id price color_id image stock category (tops,dresses,bottoms,...) subcategory (bodycon,work,evening,cocktail) Is there any way I can have it done without duplicating the values in each dropdown list? Also for each product_id, how can I store 3 different images (front view,back view and side view) for each color? Does it mean I have to create another attribute table for those images and store their names in database? I'm confused.