Forum Moderators: coopster

Message Too Old, No Replies

Show surrounding text for searchstring in query results

Displaying enhanced query results

         

nickstaw

11:44 am on Jul 20, 2007 (gmt 0)

10+ Year Member



Hello

[I am runnig PHP 4 and mySQL 3.23 and have full access to the server]

I have been searching the Internet for ages to find a way to display surrounding text for search terms in mysql query results.

For example, if I were searching for the term '%webmaster%', I would like the output to be 200 characters' worth of text, with the word 'webmaster' beginning at the 30th character position (or I would be happy to do it on a word basis instead if this is possible)

I have racked my brains and I just can't think how to do it.

I would be grateful for any help.

Cheers
Nickstaw

jatar_k

11:53 am on Jul 20, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld nickstaw,

you could try

[dev.mysql.com...]