if contains a word mysql code example
Example 1: mysql does sentence contain word
#select rows where myColumn has the actualy word (not just the string)
#ie: the word has a space on one side of it
SELECT * FROM myTable WHERE myColumn
like 'myWord'
or myColumn like 'myWord %'
or myColumn like '% myWord'
or myColumn like '% myWord %';
Example 2: mysql does sentence contain word
SELECT *
FROM myTable
WHERE myColumn REGEXP '[[:<:]]myword[[:>:]]'