Searching a text field
Moderator: General Moderators
-
chris12295
- Forum Contributor
- Posts: 113
- Joined: Sun Jun 09, 2002 10:28 pm
- Location: USA
- Contact:
Searching a text field
i need an effective way to search a text field in a database for a keyword, ive tried LIKE but it doesnt match unless someone types the exact contents and if u put LIKE %$var% it matches down to letters which isnt very relevant. i need to match words, can anyone help?
This should work :
Code: Select all
SELECT mycolumn FROM mytable WHERE mycolumn RLIKE "її:<:]]$varїї:>:]]"You can also avoid the Regular Expressions and just use this:
Notice the spaces around 'word'.
Code: Select all
SELECT field FROM table WHERE field LIKE '% word %'