Hi, I’m having trouble with the query module. I’m trying to find out when the member who is logged in purchased an item from the simple commerce module (that will determine what I display to them in terms of content).
I’m successfully putting the current member id in a php variable using this (parsing on input):
<?php
$member_id = "{member_id}";
?>and then I’m trying to query the database using this:
{exp:query sql="purchase_date as mydate, item_cost as myprice FROM exp_simple_commerce_purchases WHERE member_id = '<?php echo $member_id;?>'"}
Purchase Date: {mydate}
Item Cost: {myprice}
{if no_results}
Sorry, no results!
{/if}
{/exp:query}Nothing is being returned…not even the no results data.
Any help would be amazing! Thanks!