Q: What is the question about product attributes and product attribute values? Item table goods_id & nbsp; cat_id & nbsp; productname & nbsp; price attribute table attr_id & nbsp; cat_id & nbsp; & nbsp; attr_name & nbsp; attribute value table id & nbsp; attr_id & ask a question about product attributes and product attribute values?
Item table
Goods_id cat_id productname price
Attribute table
Attr_id cat_id attr_name
Attribute value table
Id attr_id goods_id attr_value
When the form is modified
SaveData. asp
You must first delete * from [attribute value] where goods_id = 2 and attr_id = 3, then insert into [attribute value] (attr_id, goods_id, attr_value) values (...)
I have seen that ecshop is such a processing mechanism. what do you think? Must this be done? Why can't I update [attribute values] set ......
------ Solution --------------------
This is the easiest and quickest way to do this once and for all.
Otherwise, when adding or deleting an attribute, you need to determine which attributes are deleted? What are new? Which changes have been made?
------ Solution --------------------
1. delete from tbname where goods_id = 2 and attr_id = 3
Yes no *
2. update from tbname set ......
This can also be done. The key is to find the conditions to be modified.
------ Solution --------------------
If you modify multiple records at the same time and update one record at the same time, it would be better to insert multiple records in one insert statement at the same time.