Last active
August 29, 2015 14:14
-
-
Save JudeRosario/842572cfc6dbfe05f70d to your computer and use it in GitHub Desktop.
Membership SQL Queries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get Membership Activity during a specified period | |
SELECT * FROM wp_m_membership_news | |
WHERE newsdate | |
BETWEEN '2014-12-30 00:00:01' # Put start date here | |
AND '2014-12-31 23:59:59' # Put end date here | |
# Members who successfully paid during a specified period | |
SELECT wp_users.ID, user_email, user_login, display_name, paymentmade, paymentexpires | |
FROM wp_m_member_payments | |
INNER JOIN wp_users ON wp_m_member_payments.member_id = wp_users.ID | |
WHERE paymentmade | |
BETWEEN '2014-12-30 00:00:01' # Put start date here | |
AND '2014-12-31 23:59:59' # Put end date here | |
# List all paying members on site | |
SELECT ID, user_email, user_login, display_name, | |
transaction_ID , transaction_paypal_ID , transaction_total_amount | |
FROM wp_users | |
INNER JOIN wp_m_subscription_transaction | |
ON wp_m_subscription_transaction.transaction_user_ID = wp_users.ID | |
WHERE transaction_status = 'Completed' | |
ORDER BY wp_m_subscription_transaction . transaction_ID ASC | |
# Maually set expiry dates for all members expiring on a specific date range | |
UPDATE wp_m_membership_relationships | |
SET expirydate = '2015-01-31 23:59:59' # New Date | |
WHERE expirydate > '2016-01-01 00:00:00' # Can also be a date range |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment