I am using MySQL Workbench and I'm currently looking for a function or something that helps me check if a string is within another string. For example:
text1 = 'hello , name , world';
If I have a string or varchar that is something like this
'My name is'
It should say that it contains since it has 'name' on it.
Basically what I'm trying to do is I have a Comments table and I'm creating a trigger before insert on Comments that checks if the comment_text contains any swear words. These swear words are saved like this
select group_concat(word) into texto from reserved_words;
So it has all the words close to each other: swear1,swear2,swear3,etc
I want it to update a certain table if the comment really contains a swear word.
I've tried to use LIKE, SUBSTR(),CONTAINS(),REGEXP without any success.
Can someone help?