MySQL Payment History

Discussion in 'Templates customization' started by Echelon, Aug 8, 2005.

  1. Echelon

    Echelon Guest

    Hi there,

    I'm looking for some help in displaying the payment history for a subscription option within a PHP page.

    That is, if I create a product called 'Apple' - I would like to create a page that will list how much (in total $) the product 'Apple' has generated this month.

    Can anyone help me with the query?
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    SELECT SUM(amount)
    FROM amember_payments
    WHERE completed > 0 AND product_id = 15
    AND tm_completed BETWEEN '2005-08-01 00:00:00' AND '2005-08-31 23:59:59'

    Bold text must be replaced with actual values.

Share This Page