I am trying to create search functionality for a website. In MySQL I would like to match words exactly, for example if I have a couple of posts with these titles:
A day in time
and
A coming day
and I have the following search string:
SELECT title
FROM posts
WHERE title LIKE '%in%'
ORDER BY Date
DESC
It will return both rows because the LIKE
term %in%
shows up in both in
in the first row and coming
in the second row.
But I only want it to match whole words, so that only the first row would be returned.
Is this possible?