SEOClerks

I need a php sql query very fast for solve a problem

I need a php sql query very fast for solve a problem

I need a query that do :
I need to update the favorite music genre (is associated a number to the genre) when the user listen songs. If the user lister 3 times the rock music and 2 times the pop music, the new favourite genre is the rock.

listened song are in listened
I use this query to export all the listened song for the user :
"SELECT DISTINCT * FROM albums WHERE id = ANY (SELECT album FROM Songs
WHERE id = ANY (SELECT played
FROM listened WHERE userhistory ='$nome')))
ORDER BY Rand() LIMIT 6");




Requirements

I need a query that do :
I need to update the favorite music genre (is associated a number to the genre) when the user listen songs. If the user lister 3 times the rock music and 2 times the pop music, the new favourite genre is the rock.

listened song are in listened
I use this query to export all the listened song for the user :
"SELECT DISTINCT * FROM albums WHERE id = ANY (SELECT album FROM Songs
WHERE id = ANY (SELECT played
FROM listened WHERE userhistory ='$nome')))
ORDER BY Rand() LIMIT 6");


Skills Required

php sql

Bids

No bids made yet - be the first!

Bid On Listing

Bid On Listing Created 5 years ago in Programming

Other jobs by marxmusic