modx revo snippet variable in query
- by Meddie
I noticed something weird when using a query in a snippet.
When I have a query like this:
$sql = 'SELECT * FROM table WHERE colomn = ' . $variable;
And I echo $sql, the query reads:
SELECT * FROM table WHERE colomn = <code class="php plain">2</code>
.. wich will result in an error because the sql is no longer valid.
So for now I use strip_tags to remove the code tag, but I find it not a very clean method.
I couldnt find anything about this, so maybe someone can shed some light on this for me?