So I'm trying to do a trigger in mySQL that looks like:
on table:likes, event:after insert
IF NEW.
action` = 1 THEN
INSERT IGNORE INTO matches
(user_id, user_id_friend)
(SELECT user_id_from, user_id_to
FROM likes
WHERE user_id_from = NEW.user_id_to AND user_id_to = NEW.user_id_from AND `action` = 1);
IF (SELECT user_id_from, user_id_to
FROM likes
WHERE user_id_from = NEW.user_id_to AND user_id_to = NEW.user_id_from
AND `action` = 1) IS NOT NULL
THEN
INSERT IGNORE INTO matches
(user_id, user_id_friend)
VALUES
(NEW.user_id_from, NEW.user_id_to);
END IF;
END IF`
the syntax should be right because heidi SQL (the software i'm using) allows me to save it, but when i try to insert something into likes with action = 1, it shows me: MySQL error 1241: Operand should contain 1 column(s) What am i doing wrong?