Hi,
I want to make a sql query using the value set on a placeholder. The problem is that the query does not work when I build it using the placeholder, it works if I put the value manually. Here is how I build the query usinig the placeholder and building it manually:
$sql="select name, description from sales where id=’" . ’[+id_mod+]’ . "’";
$sql2="select name, description from sales where id=’2’";
The placeholder’s value is 2.
I make the query and get the values the next way:
$result=$modx->db->query($sql);
$data=mysql_fetch_array($result);
when I do a var_dump($data) using the $sql2 I get the data and when I do it using $sql I get a bool(false)
To compare them and try to find what is happening I did a var_dump of them and what I notice is that when I build it using the placeholder it has more characters although the value is the same:
var_dump($sql); string(71) "select name, description from sales where id=’2’"
var_dump($sql2); string(62) "select name, description from sales where id=’2’"
Does anybody know how to solve it

?
Thanks in advance