I have a news system, now with commenting. I want to say # Comments where # is the total number of comments that pertain to a certain newsid.
$query1 = "SELECT COUNT( newsid ) FROM comments GROUP BY newsid";
$num = mysql_fetch_object($query1) or die (mysql_error());
but I get this error:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in
Any suggestions? I found that code from another post on this forum, and after much searching I haven't found a solution...I'll continue though while I wait for replies..