I am using the ODBC functions in PHP. I am trying to insert data into an Access database and I am recieving this error message:
Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement., SQL state 37000 in SQLExecDirect in O:\Hosted Web Sites\brandon.sungur\brandonstyle_com\profile\sign.php on line 15
here is what my script looks like:
if (isset($submit)){
$ip = $_SERVER['REMOTE_ADDR'];
$date = date('h:ia m/d/y');
$connect = odbc_connect('database, 'user', 'pass');
$query = "INSERT INTO guestbook (id, date, name, message, ip) VALUES ('NULL', '$date', '$sn', '$message', '$ip')";
odbc_exec($connect, $query); # This is line 15
odbc_close($connect);
}
I can not figure out what the syntax error is, anyone have any ideas to solve this problem?
Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement., SQL state 37000 in SQLExecDirect in O:\Hosted Web Sites\brandon.sungur\brandonstyle_com\profile\sign.php on line 15
here is what my script looks like:
if (isset($submit)){
$ip = $_SERVER['REMOTE_ADDR'];
$date = date('h:ia m/d/y');
$connect = odbc_connect('database, 'user', 'pass');
$query = "INSERT INTO guestbook (id, date, name, message, ip) VALUES ('NULL', '$date', '$sn', '$message', '$ip')";
odbc_exec($connect, $query); # This is line 15
odbc_close($connect);
}
I can not figure out what the syntax error is, anyone have any ideas to solve this problem?