May be. MySQL usually converts quoted values to the appropriate data type. But I've seen cases where it just doesn't.
I find this 'feature' very disturbing, because it confuses the programmer.
Anyway, I haven't worked with ODBC and PHP before, so maybe I'm going to make some dumb suggestions :-p
Delete the ";" at the end of your SQL code, and see if it works. In MySQL you don't have to add the extra semicolon, maybe it's the same for ODBC.
DEBUG:
Start by typing a simple: echo $sql; before you execute the code, to see how your SQL is being sent.
Check for the error message:
$res = odbc_exec($sql);
if(! $res)
{
echo odbc_errormsg();
}
- Finally, if you don't see anything wrong with your query, and the error message displayed by ODBC doesn't give you a hint, just copy the SQL statement generated by your echo $sql; statement and execute it in the SQL tool that comes with your DBMS. Native SQL Query tools provide almost always with a better description of the error.
Hope that will help you. :-)
-Gio-