开发者

Error Executing Database Query. MySql, Dreamweaver and Coldfusion

I am trying to insert data into my database, but keep getting error 1064. Which goes like this:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Add, Username, TalkID) VALUES ( 'trial' , 'andy' , 2 )' at line 1

The error occurred in C:\ColdFusion8\wwwroot\cfGossip\Gossip.cfm: line 18

16 : , < cfif IsDefined("FORM.GossipsID") AND #FORM.GossipsID# NEQ "">

17 : < cfqueryparam value="#FORM.GossipsID#" cfsqltype="cf_sql_numeric">

18 : < cfelse>

19 : NULL

20 : < /cfif>

I'm not sure what I can do to fix i开发者_如何学Got! It says the error is on line 18 - but I can't see any problems.

Both the username and TalkID are hiddenfeilds, Username is from a session variable and the TalkID from another recordset on the page. Thanks for any help.


I think the problem is that ADD is a reserved word in MySQL. rename your field (and your database column!) to a non reserved word

See: http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜