i have a table called purchased_albums
id album_id member_id date
4 8 7 2013-12-24 08:17:54
5 9 7 2013-12-29 11:03:35
6 8 10 2013-12-24 08:17:54
im trying to sort it out by most purchased albums. that is, it should count the most repeated album_id and sort it out based on that. my query keeps returning null.
$q="SELECT COUNT(album_id) as tot,album_id,date FROM purchased_albums ORDER BY tot DESC";