I have a MySQL table with a list of sentences such as:
id | Sentence
---+---------------------------------------------------------------
1 | Come On Boys, You Can do it my boy.
2 | Everything is possible, impossible itself says I am possible.
3 | Boys I know possible solutions are good!
4 | Possible solutions are all failed its also possible
I have to search on Sentence
column exact word like possible
.
There are some condition :
Searching word can't be prefix or suffix of any word.
- Searching word
possible
,impossible
is incorrect.
- Searching word
Punctuation mark can be before or after the word.Ex:
!boy
orboy,
- No case sensitive means for
possible
Possible
is correct.
I try a query but it is not working
mysql_query("SELECT * FROM products WHERE Sentence LIKE '%".$search."%'");
Possible punctuation mark are ,.!?;-
I need a working solution. Thanks in advance !