Hi,
I’m trying to run this query, but it gives no result:
{exp:query sql="SELECT item_id FROM exp_simple_commerce_purchases WHERE member_id = '{member_id}’ “}
If I replaces {member_id} by a hardcoded number it works.
Thank you
Nicolas
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
August 27, 2007 3:24pm
Subscribe [1]#1 / Aug 27, 2007 3:24pm
Hi,
I’m trying to run this query, but it gives no result:
{exp:query sql="SELECT item_id FROM exp_simple_commerce_purchases WHERE member_id = '{member_id}’ “}
If I replaces {member_id} by a hardcoded number it works.
Thank you
Nicolas
#2 / Aug 28, 2007 1:00pm
You’re running into a parse order issue. The easy way around this is to use some php parsed on input and the sessions class:
<?php
global $SESS;
$id = $SESS->userdata['member_id'];
?>
{exp:query sql="SELECT item_id FROM exp_simple_commerce_purchases WHERE member_id = '<?php echo $id; ?>' LIMIT 1"}See if that does the trick- and remember, php needs to be parsed on input.
#3 / Aug 28, 2007 1:05pm
Thank you Robin, it works.
Also I sent you an email to ask you the status of download lock pro but got no answer. Can you tell me please? This is highly wanted here.
Thx
Nicolas