Hi,
I am trying to get something out of a database using a template variable;
$catname = '[[*testvar]]';
$result = mysql_query("SELECT id FROM gegevens WHERE section_naam = '$catname' ");
But this doesn't work. The value of the template variable is "Fotograaf".
If I do this;
$result = mysql_query("SELECT id FROM gegevens WHERE section_naam = '$catname' ");
It gives me the result I want...
So even when the value of the templatevariable is "Fotograaf" it seems it's actually something else. I am not so experienced with php programming so I tried to find out why it doesn't match. I used
to find out if there is any difference between the values of "Fotograaf".
The output when using crc32 for the value of the template variabele
($catname = '[[*testvar]]';)
is 1103516372. The outcome after giving it a value myself
($catname = 'Fotograaf';)
is -657888939. That is the same value of the field in the database I am searching in. If I read the value of the template variable directly from the modx database it also gives that value.
So the variable is stored in the modx database in the right way. But when using it as a template variable something goes wrong...
The template variable is "Text", I am using MODX Revolution 2.2.0-pl2 (traditional)...
[ed. note: dimitrivisser last edited this post 14 years, 6 months ago.]