hey guys
i want to count all comment on each post in my blog, my comment table contains 4 columns
id
name
comment
postid
and my query is
[code]
$qry=mysql_query(“select count(*) as contentid from comment where id=41”) or die(mysql_error());
$res=mysql_fetch_row($qry);
echo “comments:::”.$res[‘contentid’].””;
[/code]
the output is
comment:::0
but there are 4 comments behinde id 41
count all comments on each post
Share
Can you please check whether 41 is postid or id?