|
I found this really helpful in getting up & running fast and wanted to give back as a "thanks". So here's a little bit that I added in my version:
/* create an array of words you want to exclude */
$filterWords = array('a', 'about', 'an', 'and', 'are', 'as', 'at', 'be', 'by', 'from', 'how', 'i', 'in', 'is', 'it', 'nbsp', 'of', 'on', 'or', 'that', 'the', 'this', 'to', 'was', 'we', 'what', 'when', 'where', 'which', 'with');
... later in the code ...
/* Does the current word already have a record in the word-table? */
$cur_word = addslashes( strtolower($words[$i][$j]) );
/* add the following to filter unwanted words */
if (!in_array( $cur_word, $filterWords)) {
... database selects/inserts...
}
|
$result = mysql_query(" SELECT p.page_url AS url,
COUNT(*) AS occurrences
FROM page p, word w1, occurrence o1, word w2, occurrence o2
WHERE p.page_id = o1.page_id AND
w1.word_id = o1.word_id AND
w1.word_word = \"$keyword[1]\" AND
w2.word_id = o2.word_id AND
w2.word_word = \"$keyword[2]\" AND
GROUP BY p.page_id
ORDER BY occurrences DESC
LIMIT $results" );
I think you need to change an SQL statment, could you please help me
Thanks