Click to See Complete Forum and Search --> : a sql query


nkeg
03-07-2004, 04:20 PM
Can anyone please tell me what's wrong with this sql statement?
INSERT INTO AccessCount(Date,Time,URL) VALUES('$date','$time','$referer')
I get these error messages:
Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement., SQL state 37000 in SQLExecDirect in E:\zend projects\new.php on line 30

Error executing INSERT INTO AccessCount(Date,Time,URL) VALUES('Sun.07.Mar.2004','11:48:58:pm','http://localhost/zend%20projects/banner.php') statement

Nedals
03-07-2004, 05:01 PM
My guess:
That %20 that should be a space!
Is the Date column, type date? If so, your date should be in the form: 2004-03-07
same goes for Time. Check the required format.

nkeg
03-07-2004, 07:12 PM
No, the problem was that Date and Time weren't accepted as columns' names in Access. At least it worked when I changed them to something else. Thanks :)