om_odbc sql_exec bind parameters

View thread

michaels

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?