duanba8070 2014-07-01 21:05
浏览 57
已采纳

MySQL语法错误 - 不确定问题[重复]

This question already has an answer here:

I am trying to use the following syntax to update my database, but it is not working, and when I use Instant SQL Formatter, it says:

Syntax Error: =(1,76) expected token:(

Here is the MySQL code: (that is being run by PHP)

UPDATE parts SET name='How do you use it?', part_order='0', top='334', left='44', width='150', height='26', value='', script='on mouseup
answer \"To use jsCard, all you need is an account! From there you can create stacks, then cards, then you can start building on those cards. To build on cards, simply double click on an object in the tools palette, assign a name to your new object, then, if it is a button, add a script to make it do wonderful things!\"
end mouseup', visible='1', enabled='1', style='5', family='0', locktext='0', hilite='0', autohililte='1' WHERE stacks_id=1 AND cards_id=1 AND part_id=19

Can anyone tell me what is wrong with my syntax?

</div>
  • 写回答

2条回答 默认 最新

  • drmy1050 2014-07-01 21:11
    关注

    That's probably because your INSERT statement contain the below line where left is string function and so it's expecting () around it

    left='44'
    

    You should escape it using backtique like

    UPDATE parts SET 
    name='How do you use it?', 
    part_order='0', 
    top='334', 
    `left`='44', <-- Here
    width='150', 
    height='26', 
    value='', 
    script='on mouseup
    answer \"To use jsCard, all you need ...', 
    visible='1', 
    enabled='1', 
    style='5', 
    family='0', 
    locktext='0', 
    hilite='0', 
    autohililte='1' 
    WHERE stacks_id=1 
    AND cards_id=1 
    AND part_id=19
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?