• Resolved petitpoulain

    (@petitpoulain)


    I want to count, using the e-mail as reference, how many times the people had commented on my blog.

    On the comment template, how to get the ‘comment_author_email’ of the commenter?? It must be where says HERE

    <?php
    $totalcomments = $wpdb->get_var("
    SELECT COUNT(comment_ID)
    FROM $wpdb->comments
    WHERE $wpdb->comments.comment_author_email='HERE'"); 
    
    echo $totalcomments; 
    
    ?>

    thanks, and if anyone know an easier way to to it tell me please ^^

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    <?php
    $email = get_comment_author_email();
    $totalcomments = $wpdb->get_var("
    SELECT COUNT(comment_ID)
    FROM $wpdb->comments
    WHERE $wpdb->comments.comment_author_email='$email'"); 
    
    echo $totalcomments;
    ?>
    Thread Starter petitpoulain

    (@petitpoulain)

    thanks ??

    just as i post i noticied… XD
    if i had posted before would be a lot easier.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Comment Count – Need to get commenter e-mail, but how?’ is closed to new replies.