using amember for software subscription

Discussion in 'Integration' started by nl32, Jun 6, 2005.

  1. nl32

    nl32 Guest

    Alex,

    I have software for download.
    I'm using amember to control subscription for that software.

    I added the custom field "license" which is the license number for the software randomly generated when they install it.

    I want to do a check every time they launch the software, to see if the license number is from a active and fully paid member, or not.

    Here is what I have so far:
    -------------------------------
    SELECT member_id FROM `members` WHERE data LIKE '%$license%'

    Save that $memberid

    SELECT completed FROM `payments` WHERE member_id = '$memberid" product_id = '$productid' AND product_id = '1' AND expire_date > now()

    if the result is 1, it's active, if not, then it's not active for that product.
    --------------------------------

    Is this the best way to go about it ?
    Or can you think of a more efficient or easier way to achieve this.

    NL
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Using aMember CP -> Add Fields, you may add a "SQL" field.
    Then you can rework first query as
    SELECT member_id FROM `members` WHERE data LIKE license='$license'
    and of course it will be more efficient.

Share This Page