出于某种原因,使用我的编辑脚本时出现此错误。 我甚至尝试填写POST
值并通过PHPmyAdmin
执行。这是我得到的错误:我的MySQL更新查询有什么问题?
#1064 - 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 'drop=1, sell=10, cash=10, law=7, boss=1 WHERE ID=11' at line 1
这里查询:
UPDATE toondb集名= '$ _ POST [toonname]',tlaff = $ _ POST [tlaff],[类型= $ _ POST [ttype],toonup = $ _ POST [toonup],trap = $ _ POST [trap],lure = $ _ POST [lure],sound = $ _ POST [sound],throw = $ _ POST [throw],squirt = $ _ POST [ ],drop = $ _ POST [drop],sell = $ _ POST [sell],cash = $ _ POST [cash],law = $ _ POST [law],boss = $ _ POST [boss] WHERE ID = $ _ POST [ID]
这是一个填充值:
UPDATE toondb SET name ='ik',tlaff = 137,ttype = 2,toonup = 1,trap = 1,lure = 1,sound = 1,throw = 1,squirt = 1,drop = 1 ,出售= 10,现金= 10,法律= 7,老板= 1,其中ID = 11
除了名字以外,所有列都是INT
。名称是varchar
。
“drop”是一个保留字在MySQL中:http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html – CBroe 2013-03-16 21:17:12
嗨,欢迎来到StackOverflow。请回滚您的编辑以将问题恢复为原始格式。如果您喜欢,您可以对其中一个答案发表评论,但在接收答案后不要这样更改。就目前而言,答案是毫无意义的。最后,如果您找到有用的答案,请对它们进行投票。如果它完全回答你的问题,则“接受”最佳答案。 – BellevueBob 2013-03-16 21:27:52
哦对不起。如何回滚我的编辑?我不记得它到底是什么 – llw 2013-03-17 02:17:10