I need a MySQL query to return a full sentence from a text column that contains a specified search word.
Currently I am able to get the 20 characters before and after the search word using this query:
select id, MID(body,(LOCATE('search_word', body)-20),40) from content where body like "%search_word%" limit 1
, but that's as far as I've got.
I want to get an entire sentence (between two dots) which contains my search word.
Any ideas? Regex? How do I go about doing this?