Post your code EXACTLY as it is, and echo the query string if it contains any substituted variable. Access query syntax is VERY different from mysql, or most other RDBMS for that matter. Date and string delimiters cause many problems through ODBC, as does the correct syntax for table and field names. See the notes in odbc_exec to see what I mean.
Access query syntax
SELECT [table1].[field1], [table1].[field2] FROM table1 WHERE (([table1].[field1])='blah')
is the way it goes.
If you are using Access then you can use query designer to generate the sql and then paste it into your script.
Better yet, save the query and call it by name using ODBC_EXEC. You can even create a parameter query and pass the parameters at run time; though the code for that looks a bit scary.