please help., Lets say I want to search the word "INK"
when I use LIKE Im getting every word the has the "INK" letters on it including "wrINKled".,
if I use REGEXP I will only get results that has the word 'INK" as the first word.,
I need to be able to search the exact word for example "BLAAAH INK Blah" this product will show because it has the word ink., so as "INK blah blah"..
I cant use FULLTEXT is there a way to do this using LIKE..?
Thank you in advance.. :)
The query will be
SELECT * FROM table_name
WHERE column_name LIKE 'INK %'
OR column_name LIKE '% INK'
OR column_name LIKE '% INK %'
Use LIKE % INK %
(with leading and trailing spaces)
SELECT * FROM table_name
WHERE column_name ='INK'
OR column_name LIKE 'INK %'
OR column_name LIKE '% INK'
OR column_name LIKE '% INK %'
You can use the following regexp to find words:
... WHERE your_column REGEXP '[[:<:]]ink[[:>:]]' ;
[[:<:]]
and [[:>:]]
match word boundaries.