sql语句出错

sql = "INSERT INTO table1(word) VALUES (%s)" % (str)

改为

"INSERT INTO table1(word) VALUES ('%s')" % (str)

只要是values里面的值,都需要加“”

相关文章:

  • 2021-11-09
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
猜你喜欢
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-29
  • 2021-04-10
  • 2022-12-23
相关资源
相似解决方案