Globale session variable within sc_exec_sql not working

Hello,
I found the following error in SC V7.1…2

$command = “update xy set field = [global_variable} where id = 5”;
sc_exec_sql ($command) ; … this works …

sc_exec_sql (“update xy set field = [global_variable} where id = 5”); … this doesn’t work because the variable [global_variable] is not recognized …

Seems to be a bug of compilation of the sc_exec_sql Command.

Best regards
Uwe Pfeiffer

Hi Uwe,

Application / Global Variable / Scope => Session ticked?

Or use $_SESSION[‘App’][‘Variable’] …

Hello,
the first $command is working … so SC is knowing the global variable…
sc_exec_sql also should know the variable …

Regards
Uwe

Hello,

Please turn on debug mode and see which SQL query SC is generating.

Have you tried?

(“update xy set field =”. [global_variable}." where id = 5")

regards,
Bernhard Bernsmann