Is there a better way to gather all the Simple Commerce Items “entry_id” based off the Simple Commerce Purchases? Right now i have the code below and it works a little, but i cannot figure out why it is duplicating them.
{exp:query sql="SELECT DISTINCT exp_simple_commerce_purchases.item_id, exp_simple_commerce_items.entry_id FROM exp_simple_commerce_purchases, exp_simple_commerce_items WHERE member_id = '{member_id}' AND exp_simple_commerce_items.item_id"}
{entry_id}
{/exp:query}Code above will write: “7 7 9 9 10 10”. If i am to just write out “SELECT” and not “SELECT DISTINCT” it shows them as ” 7 7 7 9 9 9 10 10 10” Is there a way to get display it as “7|9|10”? What I am trying do is have a download section for the logged in member and it show all his/her downloads.