Jump to content

counting most downloaded files within last 10 days


thara

Recommended Posts

Hi..

 

In my web site, users can download music videos. Now im going to add a top chart to my site. so need to add song to the chart according to their downloaded amount in a song and also it should be added only it's added date in last 10 days. I can create php script but have a problem in creating mysql query. Any help appreciated.

 

Thank you..

Link to comment
Share on other sites

SELECT song_id, song_title, side_bname, CONCAT_WS(' ', artist_fname, artist_mname, artist_lname) AS artist_name

FROM songs

INNER JOIN artists ON songs.artist_id = artists.artist_id

WHERE songs.song_type = 'video'

ORDER BY downloaded DESC

Link to comment
Share on other sites

thanks for your reply...

 

as you said, I changed my query like this....

 

SELECT song_id, song_title, side_bname, downloaded, CONCAT_WS(' ', artist_fname, artist_mname, artist_lname) AS artist_name

FROM songs

INNER JOIN artists ON songs.artist_id = artists.artist_id

WHERE songs.song_type = 'video' AND songs.added_date > NOW() - INTERVAL 10 DAY

ORDER BY downloaded DESC LIMIT 10

 

but it doesn't work

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.