I have a MySQL database where users can list books they've read, want to read etc. I'm trying to write a query to find the most common book that users have listed.
My current query is:
$result = mysql_query("SELECT title, COUNT(title) AS counttitle FROM books GROUP BY title ORDER BY counttitle DESC LIMIT 1");
echo "<p>The most popular book listed by members is $result</p>";
That seems (to me) to be the logical way to do it, and I can't see anything wrong with the syntax, but the result I'm getting is "The most popular book listed by members is Resource id #32"
Anyone any idea where I'm going wrong?