Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Syntax Error

Status
Not open for further replies.

streetbmx

Programmer
Dec 6, 2001
16
0
0
US
I'm not sure where I should post this but, I am using the ODBC functions in PHP. I am trying to insert data into a 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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top