Intresting way to search music
Posted: Fri Dec 10, 2010 1:37 am
hey guys i don't have an issue with my code but more of an issue with the best way to search it...
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.

Im going to leave this open to you guys and see what you think.
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'];
}