I am inserting some words into a two-column table with this command:
INSERT IGNORE INTO terms (term) VALUES (\'word1\'), (\'word2\'), (\'word3\');
Why not just:
SELECT ID FROM terms WHERE term IN ('word1', 'word2', 'word3')