WordPress.org

Support

Support » How-To and Troubleshooting » Get total value for all comments, for a specific meta_key

Get total value for all comments, for a specific meta_key

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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'

    Also, how would you display the resulting average?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get total value for all comments, for a specific meta_key’ is closed to new replies.
Skip to toolbar