Search for whole words in MySQL 3.23

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I'm setting up a database search on a site, where I will essentially be
BOOLEAN searching about 6 database fields. Unfortunately, the database I'm
using is MySQL version 3.23 (completely out of my control), so I cannot use
IN BOOLEAN MODE to simplify the process on my end. I've been able to put
together a function that does almost everything that I want, but I'm running
into a problem - searching for whole words that may or may not be in the
beginning or end of the database field. For example, syntax like this:

...WHERE `field` LIKE '%searchterm%'...

has the limitation that if the search term is 'car', it will also bring back
'scar', 'cartoon', etc.

While if the syntax is:

...WHERE `field` LIKE '% searchterm %'... (with spaces)

it misses words that are the first or last words of the field, or words that
are at the end of sentences, before commas, etc.

I've looked around and haven't been able to find a way to search only for
complete words within a block of text. Any help?

Thanks in advance,
Zeth

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux