0
answers

om_odbc sql_exec bind parameters

Hello

When I call sql_exec with a bind parameter

if (sql_exec("INSERT INTO Events (Id) VALUES(?)", $ID) == TRUE) {}

I get the following error:

INFO SQLBindParam failed; HY104:1:0:[Microsoft][ODBC SQL Server Driver] Invalid precision value

Same commnad using string concatenatiion works fine:

if (sql_exec("INSERT INTO Events (Id) VALUES(" + $ID +")") == TRUE) {}

Could you help me with it?

AskedJanuary 4, 2016 - 2:35pm