I have a string variable $ and I use
SELECT * FROM db WHERE description LIKE '%$string%' OR headline LIKE '%$string%'
As you can see, I want to find two fields "description" and "headline" to see if the string variable matches any of them.
The problem is that I want it to match whole words !!!
Example: if the description contains "hi", it is enough if $ string is "h". this is not what i want. It should correspond only to the whole word!
I split the query into words for this? or what?
user188962
source
share