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
determining which words are searched the most
Moderator: General Moderators
- DigitalMind
- Forum Contributor
- Posts: 152
- Joined: Mon Sep 27, 2010 2:27 am
- Location: Ukraine, Kharkov
Re: determining which words are searched the most
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