Skip to content

Instantly share code, notes, and snippets.

@JudeRosario
Created February 12, 2015 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JudeRosario/569d1e7e552fe71c5e56 to your computer and use it in GitHub Desktop.
Save JudeRosario/569d1e7e552fe71c5e56 to your computer and use it in GitHub Desktop.
Membership Pull List from DB
global $wpdb;
$heroes = $wpdb->get_results("
SELECT `ID` , `sub_id` , `level_id`, `user_email` , `user_login` , `display_name`
FROM `wp_m_membership_relationships`
INNER JOIN `wp_users` ON wp_m_membership_relationships.user_id = wp_users.ID
WHERE `level_id` = 1 AND `sub_id` = 2 ");
foreach ($heroes as $hero) {
// Do stuff here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment