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 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办