Merlin1 Posted July 6, 2008 Share Posted July 6, 2008 Hi, I am trying to insert a new record but i keep ending up with this: PHP Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement., SQL state 37000 in SQLExecDirect in C:\Inetpub\wwwroot\isquire\site_includes\scripts\savePostit.php on line 11 Below is the code im using (Note, i am using a connection i didnt think i would need it there as i am 100% sure thats no the problem). $post = $_GET['post']; $from = $_GET['from']; $to = $_GET['to']; $sql = "INSERT INTO ".$to." (from,post) VALUES ('$from','$post')"; odbc_exec($connp,$sql); echo $sql; odbc_close($connp); I have tried so many workarounds but i still cant get it to work. All comments apreciated. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/113444-odbc-insert-problem/ Share on other sites More sharing options...
bilis_money Posted July 6, 2008 Share Posted July 6, 2008 Are you using MSSQL or MySQL? Link to comment https://forums.phpfreaks.com/topic/113444-odbc-insert-problem/#findComment-582967 Share on other sites More sharing options...
Merlin1 Posted July 10, 2008 Author Share Posted July 10, 2008 Im using MSAccess Link to comment https://forums.phpfreaks.com/topic/113444-odbc-insert-problem/#findComment-586528 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.