Select results that contains part of string mysql php

Viewed 157

I'm looking for a method to get rows that are more similar with inserted string

For example:

SELECT * FROM db WHERE column have part of '$search_string';

In other words if search string is My name is TOM and in the column I have

COLUMN
---------------
My name is Sara

My name is Jack

My dog is white

---------------

results must be:

all rows that contains My name is, because they are most similar to $search_string.

I've tried to use LIKE operator with phrase splatted in words, but I'm not obtaining the result that I want, any ideas?

1 Answers

What about

SELECT * FROM db WHERE COLUMN LIKE 'My name is %' 

?

UPDATED

"SELECT * FROM db WHERE COLUMN LIKE '%$search%'" 
Related