Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created March 22, 2018 14:36
Show Gist options
  • Save andrewlimaza/34b23d4b19346a753ad274785dbe4178 to your computer and use it in GitHub Desktop.
Save andrewlimaza/34b23d4b19346a753ad274785dbe4178 to your computer and use it in GitHub Desktop.
Example to see all user's that cancelled within 7 days SQL
global $wpdb;
$results = $wpdb->get_results( "SELECT * FROM $wpdb->pmpro_memberships_users WHERE status='cancelled' AND enddate IS NOT NULL AND DATE_ADD(startdate, INTERVAL 7 DAY) >= enddate AND membership_id='1'" );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment