My database is currently set up to were when someone search's a song they will send a query to the database of the song and it will archive it in the database so that the search will be based on the hit count but there is a problem with this. If you search for the song with that starts with the letter a and has the greatest hitcount it will return you a random song with alot of hits attached to it.

Code: Select all
// other search parameters above this but i wont show them...
$query = mysql_query("SELECT * FROM searched ORDER BY hitcount");
while($row = mysql_fetch_array($query))
{
$items[$row['searchTerm']] = $row['searchTerm'];
}