Hi,
i’m trying to do something like this:
$var="[+somevar+]";
$query = "SELECT * FROM table WHERE x = $var";
echo $query;
$modx->db->query($query);
Here ’somevar’ is a placeholder created in another snippet if I leave out the query line everything works fine but with it I get something like
Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’[+somevar+]’ at line 1
has anyone managed to do this ?
$var=$modx->getPlaceholder(’somevar’);