Re: Free text search in MySQL

From: The Natural Philosopher <tnp_at_invalid.invalid>
Date: Wed, 30 Mar 2016 18:32:45 +0100
Message-ID: <ndh2jt$5eh$2_at_news.albasani.net>


On 30/03/16 18:04, bit-naughty_at_hotmail.com wrote:
> Hi,
> If I have the text "A rat in a hat" inside a MySQL DB, and if on my webpage someone searches for the text "rat", I would like them to get that line - how do I do that?
> I realise that this sort of *precludes* my previous question about fuzzy matching, but I would still like to know....
>
>
> Thanks.
>
Pretty much 'select from table where field like '%rat%';

Or ' %rat %' if you want the word rat by itself.

-- 
You can get much farther with a kind word and a gun than you can with a 
kind word alone.

Al Capone
Received on Wed Mar 30 2016 - 19:32:45 CEST

Original text of this message