Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Is it possible to count the comments in a category?
I'm trying to find a way to count all comments in a certain category.. Can't see how to do it from sql. Anyone found out how to do this?
0
This discussion has been closed.
Comments
edit: This link works now.
SELECT sum(`CountComments`) FROM `LUM_Discussion` WHERE `CategoryID` = 5
SELECT * FROM `LUM_Comment` LEFT JOIN `LUM_Discussion` USING `DiscussionID` WHERE CategoryID =6 ORDER BY CommentID DESC LIMIT 0 , 1
For some reason, this code isin't working, and I am too tired to figure out why right now.
I ended up getting it to work using this if anyone is curious
SELECT * FROM `LUM_Comment` LEFT JOIN `LUM_Discussion` USING ( `DiscussionID` ) WHERE LUM_Discussion.CategoryID =3 ORDER BY LUM_Comment.CommentID DESC LIMIT 0 , 1
Select count(lum_Comment.commentid) from lum_Comment, lum_Discussion where lum_Comment.discussionID = lum_Discussion.discussionID and lum_Discussion.categoryID = 11 and where lum_Comment.deleted = "0";
This one is better! It takes about .005 seconds without server lag (estimate I am logged in remotely, my actual time was .06 which is way to long)