I have a MySQL database in which users can view books they have read, want to read, etc. I am trying to write a query to find the most common book that users have indicated.
My current request:
$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>";
It seems to me that this is a logical way to do this, and I see nothing wrong with the syntax, but the result I get is "The most popular book listed by members is resource identifier # 32"
Does anyone know where I am going wrong?
source share