Question about product attributes and product attribute values

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.