Piyush Posted January 15, 2010 Share Posted January 15, 2010 my access table structure is like this....id(autoincrement),title(text),filename(text),ext(text),by(Number),ts(number),description(text),nodownloads(number)My query was like this....INSERT INTO 'download' ('title','filename','ext','by','ts','description','nodownloads') VALUES ('Ultra Surf','U992','exe',1,1263571417,'Proxy Tools',0)and i got error..Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in query. Incomplete query clause., SQL state S1000 in SQLExecDirect in C:\Inetpub\wwwroot\root\index.php on line 9Please help me Link to comment Share on other sites More sharing options...
alexnofue Posted January 15, 2010 Share Posted January 15, 2010 Hi, the only posible error i see is that BY is a sql keyword, that might be a problem, but i'm kind of guessing. Link to comment Share on other sites More sharing options...
justsomeguy Posted January 15, 2010 Share Posted January 15, 2010 I haven't used Access in years, but I'm pretty sure you're not supposed to quote table and field names like you quote a string. They're not strings, they're names. Link to comment Share on other sites More sharing options...
Piyush Posted January 17, 2010 Author Share Posted January 17, 2010 thanks i will try hanging field name.. Link to comment Share on other sites More sharing options...
Piyush Posted January 18, 2010 Author Share Posted January 18, 2010 Hi, the only posible error i see is that BY is a sql keyword, that might be a problem, but i'm kind of guessing. I have now change the feild name from 'by' to 'from'and so the query became thisINSERT INTO download (title,filename,ext,from,ts,description,nodownloads) VALUES ('Ultra Surf','U992','exe',1,1263845361,'',0)but now the error isWarning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement., SQL state 37000 in SQLExecDirect in C:\Inetpub\wwwroot\root\index.php on line 10 Link to comment Share on other sites More sharing options...
justsomeguy Posted January 18, 2010 Share Posted January 18, 2010 What's with all the keywords? You haven't used a select statement?SELECT * FROM ...How about 'author', or 'uploader', or 'posted_by' or some other name that's not in this list:http://office.microsoft.com/en-us/access/HA100306431033.aspx Link to comment Share on other sites More sharing options...
Piyush Posted January 20, 2010 Author Share Posted January 20, 2010 What's with all the keywords? You haven't used a select statement?SELECT * FROM ...How about 'author', or 'uploader', or 'posted_by' or some other name that's not in this list:http://office.microsoft.com/en-us/access/HA100306431033.aspx Oh....sorry...i was not able to recognize that.thx.iwill try.. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.