I’m trying to modify a table from OpenCart, a PHP-based e-cart solution. I currently have the oc_product_to_store table populated with the 1300+ product catalog we currently offer. We created a second store and I want to update that table for every product_id to have a second row pointing to the second store (so, in practical reality, I want to insert the 1 value into the store_id field for each new row, while preserving the product_id value).
My question is: is it doable in a single query? Something ala INSERT […] SELECT where I get the product_id field through the query and specifying the store_id ‘manually’ at the same time?
Or maybe I should try a LOOP instead?
I’m scratching my head a bit, but I find it a bit difficult. Any hint?
So you mean?
(where 1 is your existing store , and 2 is your new store)