Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save staycreativedesign/66c38536bcd2238282815c5e4d74538a to your computer and use it in GitHub Desktop.
Save staycreativedesign/66c38536bcd2238282815c5e4d74538a to your computer and use it in GitHub Desktop.
SELECT id FROM `caffeine_product_options`WHERE `product_option_title` = "we start with 5";
UPDATE caffeine_product_options SET option_qty = option_qty - '$quantity' WHERE id= is_set_from_select
@nilbus
Copy link

nilbus commented May 22, 2020

UPDATE caffeine_product_options 
SET option_qty = option_qty - '$quantity' 
WHERE id IN (
  SELECT id 
  FROM `caffeine_product_options`
  WHERE `product_option_title` = "we start with 5"
);

@nilbus
Copy link

nilbus commented May 22, 2020

UPDATE caffeine_product_options 
SET option_qty = option_qty - '$quantity' 
WHERE `product_option_title` = "we start with 5";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment