I am not able to make get the following code to work in a snippet. I set the template to allow php and parse on input. I am not able to get the userdata call to work in the template either.
{exp:query sql="SELECT DISTINCT name
FROM purchases
WHERE name = '<?php echo $this->EE->session->userdata['username']; ?>' "}
<a href="#" class="menu_link">{name}</a>
{/exp:query}I think my issues are with the parsing order. Does php inside a snippet get parsed before a module tag?
Thanks in advance for helping 😊
Edit: I am using MSM, could this be causing the problem?