Page 1 of 1

word counts from text field

Posted: Fri Jun 09, 2006 12:31 pm
by harsh789
Hi,

I want to calculate the numbers of occurances of a word in a text type table filed in mysql query.

For ex. say filed name 'content' in a 'pages' table have value "This is a very good web site", then query for "is" word shoud return 2.

Thanks for your valuable help.

Posted: Mon Jun 12, 2006 10:02 am
by pickle
The first thing that came to mind is to make your search a regular expressions, then throw it and the string you're searching at preg_match_all().