CREATE TRIGGER marketing_list_update
AFTER UPDATE
ON cms_offers
FOR EACH ROW
begin
if NEW.status = 'active'
then UPDATE marketing_credits_requests SET sum_s=NEW.ammount, statut=NEW.status WHERE id_req=old.id;
else then UPDATE marketing_credits_requests SET statut=NEW.status WHERE id_req=old.id;
end;
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 7
IF search_condition THEN statement_list
[ELSEIF search_condition THEN statement_list] ...
[ELSE statement_list]
END IF