I am trying to have a trigger check if two values in a table are the same and if so insert the information into another table. My code is below.
user_id is a INT(10) post_author_id is a VARCHAR(33) 8utf_unicode_ci
CASE
WHEN (new.user_id = (SELECT CAST(post_author_id AS UNSIGNED INTEGER) FROM Cvr_hooks_501_1000))
THEN
INSERT INTO Cvr_1_link_501_1000 (a_hook_id, a_user_id, a_post_id, a_post_author_id)
VALUES (new.hook_id,
new.user_id,
new.post_id,
new.post_author_id);
END CASE
Any help is appreciated!