i have a search system that searches for a word a user inputs...
now i can display all the results based on the pages
ex:
1. this page has that word
2.this page has that word
and so on... but id like to add a sentence from the page that contains that word..
ex:
1. this page has the word
and this is some text that has the word and this is some text after the word
i hope that made sense, what im trying to do is grab text around the the search term which in this example is word, but when using the sub string select all it does is grab the characters i define
ex:
$query = "SELECT SUBSTRING(page_content,100,180) AS 'search_string' FROM pages WHERE page_content LIKE '%$trimmed%'";
Bookmarks