I tried random things. odbc_prepare() seems to detect parameters if you use one of these syntaxes (or you even mix them):
INSERT INTO foo (bar) VALUES (:param)INSERT INTO foo (bar) VALUES ([param])
However, odbc_execute() will complain about the lack of parameters no matter what you feed it with (numerical array, associative array ...). And he will know the exact number of parameters that cannot be found. This makes the whole mechanism completely pointless.
Let's say my best solution so far is this:
function odbc_escape_string_access($value){ $replacements= array( "'" => "''", ); return strtr($value, $replacements); }
This is terrible, but I could not find anything better.
Álvaro González
source share