I am wondering how I can make this work, I tried:
$query = "SELECT author, SUM(likes) FROM posts WHERE author = '$usern' GROUP BY likes order by SUM(likes) + 0 desc";
$result = mysql_query($query) or die(mysql_error());
But it just gives me number of likes of first post, not from all posts in-one. So, I need to get all likes from all posts where username is $usern
Database rows: id, likes, author, date
I need to output one number, e.g. 50 if the author has 5 posts and on every post 10 likes