Created
December 23, 2017 02:52
-
-
Save dmmoelle/0d5bf6629afc556311d80f5f816ea368 to your computer and use it in GitHub Desktop.
This file contains 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
SELECT | |
o.user_id, | |
o.timestamp, | |
(select user_login from wp_users where id = o.user_id limit 1) as user_login, | |
(select user_email from wp_users where id = o.user_id limit 1) as user_email, | |
(select name from wp_pmpro_membership_levels where id = o.membership_id limit 1) as level, | |
o.total, | |
(select meta_value from wp_usermeta where user_id = o.user_id and meta_key = 'last_name' limit 1) as last_name, | |
(select meta_value from wp_usermeta where user_id = o.user_id and meta_key = 'first_name' limit 1) as first_name, | |
(select meta_value from wp_usermeta where user_id = o.user_id and meta_key = 'pmpro_saddress1' limit 1) as address, | |
(select meta_value from wp_usermeta where user_id = o.user_id and meta_key = 'pmpro_scity' limit 1) as city, | |
(select meta_value from wp_usermeta where user_id = o.user_id and meta_key = 'pmpro_sstate' limit 1) as state, | |
(select meta_value from wp_usermeta where user_id = o.user_id and meta_key = 'pmpro_szipcode' limit 1) as zip, | |
(select meta_value from wp_usermeta where user_id = o.user_id and meta_key = 'dob' limit 1) as dob, | |
(select meta_value from wp_usermeta where user_id = o.user_id and meta_key = 'phone' limit 1) as phone | |
FROM wp_pmpro_membership_orders o | |
WHERE o.status = 'success'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment