I'm making a search engine for my site and I'm using this sort of query:
SELECT * FROM $tbl WHERE LOWER(content) LIKE '% $s[$index] %')
The $s[$index] value is a single word.
I want MySQL to find matches that have complete words, not parts of words. Like if I search for "paint shop PRO", I don't want it to find pages with "PROfessional" written in them, so I'm using LIKE '% $s[$index] %' as part of my query (notice the spaces). This works in most cases to find a complete word, but lets say someone searches for "bear" and I have the word bear in a page, but it's writte in the page like this:
It was the bear.
It won't find that page because of the period. Remember, the query was looking for [space]$word[space], and not [space]$word[period].
I hope you understand what I mean. Hopefully someone can take sometime to read this and help. Thanks a lot.