【问题标题】:Python MySQLdb failing to insertPython MySQLdb无法插入
【发布时间】:2012-10-20 02:00:22
【问题描述】:

我在努力

title = "Title here"
url = "http://www.mysite.com/url-goes-here"

cursor.execute("""INSERT INTO `videos_justicevids` (`title`, `pageurl`) VALUES (%s, %s)""",(title, url))

我没有收到错误,但它没有插入到数据库中。

【问题讨论】:

    标签: python cursor


    【解决方案1】:

    你需要提交它。

    connection.commit()
    

    【讨论】:

      猜你喜欢
      • 2010-10-11
      • 2012-03-25
      • 2014-11-22
      • 2015-09-05
      • 1970-01-01
      • 2018-01-05
      • 2018-05-11
      • 2013-12-26
      • 2023-03-26
      相关资源
      最近更新 更多