I'm using PHP to query a MySQL database. When I get the results, I want to display all the records to the user but I only want to display so many words that come before and after the search word. Like show the 10 words that precede the search word and the 10 words that come after the search word.

Basically in PHP I have a simple query structure like,
PHP Code:
$query='SELECT * FROM table WHERE content like "%'.$search.'%"';
$row=mysql_fetch_array($sqlresult); 
But since CONTENT can contain paragraphs of information, I want to strip it down before I display it to the user.

I'm not sure if MySQL has a function to do this, but if it does, I'd be willing to use it instead of PHP.