Is There An Easy Way To Pull Out Data?

Discussion in 'Customization & add-ons' started by neilhedley, Aug 18, 2003.

  1. neilhedley

    neilhedley Guest

    My site has ONE members area, but SIX different price plans to get there.
    Basically, four of them include some support materials that we mail to you, two are for "web only" access.

    I need to build a mySQL query that will identify ACTIVE users who have purchased either Product 1, Product 2, Product 3 or Product 4.
    I know there is a column marked "status" in the amember_members table, but I can't find anywhere that specifies the PRODUCT, save the "a:4" mark at the very beginning of the "data" field. (And quite frankly, I wouldn't know how to parse that out of the field, and I'm not 100% sure that it will appear in the same place in every user's record.)

    Can one of the amember gurus point me in the right direction?

    Thanks
    --Neil
  2. alex-adm

    alex-adm Guest

    Code:
    SELECT p.*
       FROM amember_payments p 
       WHERE completed>0 AND begin_date <= NOW() AND expire_date <= NOW() AND product_id IN (1,2,3,4)
    

Share This Page