Page 1 of 1

determining which words are searched the most

Posted: Wed Sep 29, 2010 11:23 pm
by Smudly
Hey, I have a search feature that searches for words in my database.
I am currently storing all searches that users make in a table called `search`. I need to list the top 10 words that are searched for the most, excluding common words like "the, and, or, etc".
Because the searches users make are stored into a table, it should be fairly easy.
Could anyone give an example of how to do this?

Here's how my sql table looks:

table name: search

columns:
id (autoincrement)
phrase
date
resultsfound
ip

Re: determining which words are searched the most

Posted: Thu Sep 30, 2010 6:24 am
by DigitalMind

Code: Select all

select phrase, count(*) as phrase_count from search where phrase not in ('the', 'and', 'or', 'etc') group by phrase order by phrase desc limit 10