Get All Users

Discussion in 'aMember Pro v.4' started by xindexer, Apr 7, 2012.

  1. xindexer

    xindexer Member

    Joined:
    Apr 17, 2011
    Messages:
    52
    How do I get all users that are subscribed to a product (actually to an array of products)

    Thanks
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    aMember CP -> Browse users -> advanced filter -> Subscribers to any of:
  3. xindexer

    xindexer Member

    Joined:
    Apr 17, 2011
    Messages:
    52
    Sorry, was looking for this in code

    something like

    PHP:
    $users Am_Di::getInstance()->AccessTable->allUsersWithProducts(array(2,5,8,9));
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    This will return array of user_ids
    PHP:
    Am_Di::getInstance()->getDbService()->selectCol("select distinct(user_id) from ?_access where product_id in (?a) and begin_date <= now() and expire_date>=now()", array(1,2,3));

Share This Page