Total Sum by user id and action taken by user php mysql query

id  post_id     meta_key     meta_value
1   101         tweet_point        5
2   101         tweet_user_id      1
3   101         email_point        10
4   102         fb_point           10
5   102         fb_user_id         1
6   101         email_user_id      2
7   101         chat_point         5
8   102         tweet_point        2 
9   102         tweet_user_id      2
10  101         chat_user_id       2

From above table if user id does a tweet on one post, and a fb post on another post I want to sum those point together.
How I can do this in php mysql. I am using wordpress.
The result I am seeing is as below

user_id  total
1        15
2        17

Read more here: Total Sum by user id and action taken by user php mysql query

Leave a Reply

Your email address will not be published. Required fields are marked *