Jump to content

odbc INSERT problem.


Merlin1

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.