I have a column name in my table. Which have value Fresh Cream for example.
And input string have value like This product is made of fresh cream and it is fresh made.
I have tried using regular expression by splitting the string on base of string like
Select * From products where product_name REGEXP ('[[:<:]]This[[:>:]]|[[:<:]]product[[:>:]]|[[:<:]]made[[:>:]]|[[:<:]]of[[:>:]]|[[:<:]]fresh[[:>:]]|[[:<:]]cream[[:>:]]')
But in this case it is also getting the records with the value Chicken with cream. But I want exact match of Fresh cream.
Is there a way to use locate() function like that,
Select * from products where locate(poducts.product_name , 'This product is made of fresh cream and it is fresh made')>0
Or something like That
"Select * from products where product_name like '%fresh cream%"%before and after your product_name column value, and then use LIKE to compare with the static search input string.