Subscription info for members are stored in what table ?

I want to grab a members subscription level and use it in unrelated section in my website. I have looked in the database and I can locate it, does anyone know where this information is stored? Thanks for any help.

  • PC

    Hello Marshal,

    Greetings and thanks for posting on the forums.

    Though I have not got into the db, but if you go to the Membership >> Options >> Advanced and click on Verify Membership tables, it will list all the tables which the plugin is using.

    It will look like this

    Checking table : wp_8_m_membership_levels - Ok

    Checking fields in table : wp_8_m_membership_levels -
    id - Ok
    level_title - Ok
    level_slug - Ok
    level_active - Ok
    level_count - Ok

    Checking table : wp_8_m_membership_relationships - Ok

    Checking fields in table : wp_8_m_membership_relationships -
    rel_id - Ok
    user_id - Ok
    sub_id - Ok
    level_id - Ok
    startdate - Ok
    updateddate - Ok
    expirydate - Ok
    order_instance - Ok
    usinggateway - Ok

    Checking table : wp_8_m_membership_rules - Ok

    Checking fields in table : wp_8_m_membership_rules -
    level_id - Ok
    rule_ive - Ok
    rule_area - Ok
    rule_value - Ok
    rule_order - Ok

    Checking table : wp_8_m_subscriptions - Ok

    Checking fields in table : wp_8_m_subscriptions -
    id - Ok
    sub_name - Ok
    sub_active - Ok
    sub_public - Ok
    sub_count - Ok
    sub_description - Ok
    sub_pricetext - Ok

    Checking table : wp_8_m_subscriptions_levels - Ok

    Checking fields in table : wp_8_m_subscriptions_levels -
    sub_id - Ok
    level_id - Ok
    level_period - Ok
    sub_type - Ok
    level_price - Ok
    level_currency - Ok
    level_order - Ok
    level_period_unit - Ok

    Checking table : wp_8_m_subscription_transaction - Ok

    Checking fields in table : wp_8_m_subscription_transaction -
    transaction_ID - Ok
    transaction_subscription_ID - Ok
    transaction_user_ID - Ok
    transaction_sub_ID - Ok
    transaction_paypal_ID - Ok
    transaction_payment_type - Ok
    transaction_stamp - Ok
    transaction_total_amount - Ok
    transaction_currency - Ok
    transaction_duedate - Ok
    transaction_gateway - Ok
    transaction_note - Ok
    transaction_expires - Ok

    Checking table : wp_8_m_urlgroups - Ok

    Checking fields in table : wp_8_m_urlgroups -
    id - Ok
    groupname - Ok
    groupurls - Ok
    isregexp - Ok
    stripquerystring - Ok

    Checking table : wp_8_m_communications - Ok

    Checking fields in table : wp_8_m_communications -
    id - Ok
    subject - Ok
    message - Ok
    periodunit - Ok
    periodtype - Ok
    periodprepost - Ok
    lastupdated - Ok
    active - Ok
    periodstamp - Ok

    Checking table : wp_8_m_pings - Ok

    Checking fields in table : wp_8_m_pings -
    id - Ok
    pingname - Ok
    pingurl - Ok
    pinginfo - Ok
    pingtype - Ok

    Checking table : wp_8_m_ping_history - Ok

    Checking fields in table : wp_8_m_ping_history -
    id - Ok
    ping_id - Ok
    ping_sent - Ok
    ping_info - Ok
    ping_return - Ok

    Checking table : wp_8_m_levelmeta - Ok

    Checking fields in table : wp_8_m_levelmeta -
    id - Ok
    level_id - Ok
    meta_key - Ok
    meta_value - Ok
    meta_stamp - Ok

    Checking table : wp_8_m_subscriptionmeta - Ok

    Checking fields in table : wp_8_m_subscriptionmeta -
    id - Ok
    sub_id - Ok
    meta_key - Ok
    meta_value - Ok
    meta_stamp - Ok

    Checking table : wp_8_m_member_payments - Ok

    Checking fields in table : wp_8_m_member_payments -
    id - Ok
    member_id - Ok
    sub_id - Ok
    level_id - Ok
    level_order - Ok
    paymentmade - Ok
    paymentexpires - Ok

    Checking table : wp_8_m_coupons - Ok

    Checking fields in table : wp_8_m_coupons -
    id - Ok
    site_id - Ok
    couponcode - Ok
    discount - Ok
    discount_type - Ok
    discount_currency - Ok
    coupon_startdate - Ok
    coupon_enddate - Ok
    coupon_sub_id - Ok
    coupon_uses - Ok
    coupon_used - Ok

    and it seems that the below table will store it

    Checking table : wp_8_m_subscriptions - Ok

    Checking fields in table : wp_8_m_subscriptions -
    id - Ok
    sub_name - Ok
    sub_active - Ok
    sub_public - Ok
    sub_count - Ok
    sub_description - Ok
    sub_pricetext - Ok

    I hope that helps. Please feel free to ask if you have more questions on the same.

    Cheers
    PC
    Sales &Support

  • Barry

    Did you know there are classes and functions that you can use so that you don't have to go digging in tables? :slight_smile:

    The table is wp_m_membership_relationships, which holds the membership relationships of users.

    I want to grab a members subscription level

    To get the level ids a member is on

    $member = new M_Membership( $user_id );
    $onlevels = $member->get_level_ids();

    To get the subscription ids

    $member = new M_Membership( $user_id );
    $onsubs = $member->get_subscription_ids();

    To return the relationships this member has (pulls out the relationship table I mentioned above)

    $member = new M_Membership( $user_id );
    $rels = $member->get_relationships();

    Have a look in the membershipincludes/classes/class.membership.php file for all the member related functions available to you

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.