simon76 Posted February 20, 2016 Share Posted February 20, 2016 (edited) Hi, I am hoping that someone may be able to help me. I am trying to update the "Selected Carriers" in products by using SQL. I have just set up three carriers which need to be "selected carriers" for all products as they cover different weights. I can update the selected carriers with one carrier (see below) UPDATE ps_product_carrier SET id_carrier_reference=2 WHERE id_product=10 but I cannot work out the correct syntax for updating three carriers with a ID Carrier reference of "2", "26" and "29". I thought it might be something like: UPDATE ps_product_carrier SET id_carrier_reference='2', '26', '29' WHERE id_product=10 but this doesn't work. Does anyone have any ideas. Thanks Simon Edited February 20, 2016 by simon76 (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted February 22, 2016 Share Posted February 22, 2016 You need more records. Consider to use INSERT or REPLACE: http://dev.mysql.com/doc/refman/5.7/en/replace.html id_carrier_reference=2, id_product=10 id_carrier_reference=26, id_product=10 id_carrier_reference=29, id_product=10 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now