Hey - how's it going?
I've been asked to export the all the payment methods for a plan on my site so the committee can make a decision on which gateways to keep... but I am getting lots of duplicate records (I should be getting around 192 results, but am getting 900+
This is my sql - any ideas where I'm going wrong
Code:
SELECT a.`id`
, a.`username`
, c.`plan_id`
, d.`payment_method`
, c.`status`
, c.`subscription_date`
FROM `j25_users` AS a
INNER JOIN `j25_comprofiler` AS b
ON b.`user_id` = a.`id`
INNER JOIN `j25_cbsubs_subscriptions` AS c
ON c.`user_id` = b.`user_id`
INNER JOIN `j25_cbsubs_payments` AS d
ON d.`for_user_id` = c.`user_id`
INNER JOIN `j25_cbsubs_payment_items` AS e
ON e.`payment_basket_id` = d.`payment_basket_id`
WHERE c.`plan_id` = 20