fieldType='text' AND fieldContent REGEXP ('[[:<:]]".$searchData."[[:>:]]') ";
So I get back a result that only match the whole word of searchData. Next I would like to display an exerpt of the text surrounding the word found with the word(s) found in bold. I've tried this where $searchFound is the mySQL result:
$findNumber=strpos(strtolower ($searchFound),strtolower($searchData)); $startNumber= ($findNumber-50)>0 ? $findNumber-50 : 0;
So next I use the $startNumber variable and do a substr on it to display a little exerpt from the result found. The problem is although the mySQL will only return whole words, the strpos will match "the" with "them" and so on.
Although I'm not too familiar with it, I looked into using ereg a little and can't seem to find a use for it with what I'm doing because it only returns true or false and I need to know the location of the string found.