Hi All, just wondering someone out there could help me solve a little problem in my mysql database:
Table 1 Name: wp_wpsc_product _files
Fields: ID, Name, Description, Additional_Desc ription
Table 2 Name: wp_wpsc_product meta
Fields: ID, Product_ID, Meta_key, Meta_Value
The Product_ID in the second table – is the link to the ID field in the wp_wpsc_product _files table
The table wp_wpsc_product meta where meta_key = SKU has the info I need in the meta_value field for each
Product in the wp_wpsc_product _files table
In the additional_desc ription field (its a long text field type) there is a string of characters within a lot of other info – the string is: HDKLEPTO
The HDKLEPTO string is in the additional_desc ription field for every product in the product_files table.
I need to replace this HDKLEPTO string with the products correct info from the productmeta table which has the correct info for each product
In the meta_value field where the meta_key=SKU
Pseudo-code::
Update wp_wpsc_product _files
Set additional_desc ription
Replace within additional_desc ription HDKLEPTO
with value from wp_wpsc_product meta meta_value field
join wp_wpsc_product _files and
Wp_wpsc_product meta using product_id and ID field
Find meta_value where meta_key = “SKU”
note: the additional_desc ription field contains other strings of info that I don't want to loose...only want to replace that one string with the correct value for that particular product by find the value for that product in the productmeta table.
hope this makes sense :)
Table 1 Name: wp_wpsc_product _files
Fields: ID, Name, Description, Additional_Desc ription
Table 2 Name: wp_wpsc_product meta
Fields: ID, Product_ID, Meta_key, Meta_Value
The Product_ID in the second table – is the link to the ID field in the wp_wpsc_product _files table
The table wp_wpsc_product meta where meta_key = SKU has the info I need in the meta_value field for each
Product in the wp_wpsc_product _files table
In the additional_desc ription field (its a long text field type) there is a string of characters within a lot of other info – the string is: HDKLEPTO
The HDKLEPTO string is in the additional_desc ription field for every product in the product_files table.
I need to replace this HDKLEPTO string with the products correct info from the productmeta table which has the correct info for each product
In the meta_value field where the meta_key=SKU
Pseudo-code::
Update wp_wpsc_product _files
Set additional_desc ription
Replace within additional_desc ription HDKLEPTO
with value from wp_wpsc_product meta meta_value field
join wp_wpsc_product _files and
Wp_wpsc_product meta using product_id and ID field
Find meta_value where meta_key = “SKU”
note: the additional_desc ription field contains other strings of info that I don't want to loose...only want to replace that one string with the correct value for that particular product by find the value for that product in the productmeta table.
hope this makes sense :)
Comment