Let's say I have this text stored in a table in my database:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, eiusmod sed tempor inciudunt ut labore et dolore magna aliqua. Ut enim ad minim come, wanted nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
If I query the word reprehenderit , I'd like something similar to this in my application in PHP / HTML
: >... aute irure dolor in reprehenderit in voluptate velit esse ...
I've been reading about the FULL-TEXT query, but I need to return the words around the term of the query instead of the whole text. It would be three or four words before and after the query term.
How do I do it?