diff options
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r-- | modules/comment/comment.module | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index f77dd65d9..caaca8f09 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1470,7 +1470,7 @@ function comment_num_all($nid) { static $cache; if (!isset($cache[$nid])) { - $comment = db_fetch_object(db_query("SELECT COUNT(c.nid) AS number FROM {node} n INNER JOIN {comments} c ON n.nid = c.nid WHERE n.nid = %d AND c.status = 0 GROUP BY n.nid", $nid)); + $comment = db_fetch_object(db_query("SELECT COUNT(nid) AS number FROM {comments} WHERE nid = %d AND status = 0 GROUP BY nid", $nid)); $cache[$nid] = $comment->number ? $comment->number : 0; } return $cache[$nid]; |