WordPress.org

Ready to get started?Download WordPress

Forums

Get total value for all comments, for a specific meta_key (3 posts)

  1. Sarah_Frantz
    Member
    Posted 1 year ago #

    Any thoughts on how to get the total value for all comments from a specific post, for a specific comment meta_key?

  2. Sarah_Frantz
    Member
    Posted 1 year ago #

    Would I do something like this for my query?

    SELECT AVG(wp_commentmenta.meta_value)
    FROM wp_commentmeta, wp_comments
    WHERE wp_commentmeta.comment_ID = wp_commnets.comment_ID
    AND wp_comments.comment_post_id = $post->ID
    AND wp_comments.meta_key = 'performance'
  3. Sarah_Frantz
    Member
    Posted 1 year ago #

    Also, how would you display the resulting average?

Topic Closed

This topic has been closed to new replies.

About this Topic