Make WordPress Core


Ignore:
Timestamp:
11/16/2005 06:29:36 AM (20 years ago)
Author:
ryan
Message:

Add comment_count to the posts table. Props donncha. fixes #1860

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r3103 r3104  
    13071307
    13081308    // Do the same for comment numbers
    1309     $comment_counts = $wpdb->get_results("SELECT comment_post_ID, COUNT( comment_ID ) AS ccount
    1310     FROM $wpdb->comments
    1311     WHERE comment_post_ID IN ($post_id_list)
    1312     AND comment_approved = '1'
    1313     GROUP BY comment_post_ID");
     1309    $comment_counts = $wpdb->get_results( "SELECT ID as comment_post_ID, comment_count as ccount FROM $wpdb->posts WHERE ID in ($post_id_list)" );
    13141310
    13151311    if ( $comment_counts ) {
Note: See TracChangeset for help on using the changeset viewer.