1

Ultimately what I'm trying to do is this:

When CCT1 is updated, also update CCT2.

What Row? The row with the matching ID (CCT1 ID:16 = CCT2 ID:16)

CCT1: ’O1cUxE_jet_cct_raffles.raffle_id’

CCT2: ’O1cUxE_rafflepro_tickets_setting.category_id’

From data entered into a specific column in CCT1: ‘O1cUxE_jet_cct_raffles.raffle_start_date’

I’d like to update a specific column in CCT2: ‘O1cUxE_rafflepro_tickets_setting.raffle_dates_from’

Here's what I've got so far... I'm sure its not even close haha.

Screenshot


CREATE TRIGGER `Update Raffle Ticket Pro` AFTER UPDATE ON `O1cUxE_jet_cct_raffles`
FOR EACH ROW UPDATE O1cUxE_rafflepro_tickets_setting
SET raffle_dates_from = O1cUxE_jet_cct_raffles.raffle_start_date
WHERE O1cUxE_rafflepro_tickets_setting.category_id = O1cUxE_jet_cct_raffles.raffle_name

1
  • 2
    In the trigger's query definition, replace both O1cUxE_jet_cct_raffles references with NEW. Commented Mar 5, 2022 at 23:45

1 Answer 1

1

the old values before the UPDATE you get by using for example OLD.raffle_start_date

The updated Values you get by using for example NEW.raffle_start_date

CREATE 
    TRIGGER  `Update Raffle Ticket Pro`
 AFTER UPDATE ON `O1cUxE_jet_cct_raffles` FOR EACH ROW 
    UPDATE O1cUxE_rafflepro_tickets_setting 
      SET raffle_dates_from = NEW.raffle_start_date 
      WHERE O1cUxE_rafflepro_tickets_setting.category_id = NEW.raffle_name
Sign up to request clarification or add additional context in comments.

1 Comment

YES! This did it... Thanks so much for your help... Can't thank you enough!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.