I would like to implement a way to track searches to create a top 10 most searched for list but I'm looking to see what way others would do it.
My first idea was to add each search term to a mysql table and then using a group function when getting the records from MySQL but figured that may not be the best way since it will likely end up creating tens of thousands of rows.
Another I had was to have a table with the fields 'term' and 'count' and trying to match the search term in the table when someone performs a search and if it's found add 1 to the count, if not add it to the table.
The second way seems the best idea but anybody have a better way to do it?