Hello community,
I am trying to give a value to a php-var and use this later on the page in an ee-query.
Is this impossible or is there something wrong with my code ?
{exp:channel:entries channel="test" studio_id="{segment_2}"}
// a lot of irrelevant code here
<?php
$phpvar = "{residentie}";
echo $phpvar; // this works > i see the value on the page
?>
{/exp:channel:entries}
// in this part i want to use the php-var in the query > this doesn't seem to work
{exp:query sql="SELECT entry_id FROM exp_channel_data WHERE field_id_1 = '<?php echo $phpvar; ?>' "}
entry_id : {entry_id} // no entry_id showed on the page
{/exp:query}Any advice ???
THX