0
votes

I noticed something weird within 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>

.. which 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 to be not a very clean method.

I couldn't find anything about this issue, so maybe someone can shed some light on this for me?

2

2 Answers

0
votes

I've never seen revo do anything like that, just using a normal browser to view the page, not some odd tool?

What happens if you:

$sql = "SELECT * FROM table WHERE colomn = '".$variable."';";

0
votes

What are you trying to query with that bare bones SQL? MODX uses XPDO to retrieve their data.

Please try to learn this to get the grip.

http://rtfm.modx.com/display/xPDO20/Retrieving+Objects

It's the basic query for a start.