MySQL命令由于&#x27而无法工作。在场
使用mySQL连接器,我尝试执行此行
“插入line(line_name,stop,bus_num)values('blue','['canca'','us'],'[qwe123','qwr123 ']')”
mySQL似乎会发现语法错误,但是如果我宁愿执行此
“插入line(line_name,stop,stop,bus_num)values('blue'','[Canada,US]' ,'[QWE123,QWR123]')”
它的工作平稳,但可悲的是,在Python中,无法从字符串类型变量中删除'
。有人知道如何解决这个问题吗?
using mysql-connector I have tried executing this line
"insert into line (Line_Name, Stops, Bus_Num) values ('Blue', '['Canada', 'US']', '['qwe123', 'qwr123']')"
MySql seems to find a syntax error, but if I rather execute this
"insert into line (Line_Name, Stops, Bus_Num) values ('Blue', '[Canada, US]', '[qwe123, qwr123]')"
It works smooth, but sadly in python its impossible to remove the '
from a string type variable. Does anyone have any idea how I can fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论