Python MySQLdb无法插入 [英] Python MySQLdb failing to insert
本文介绍了Python MySQLdb无法插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在尝试
title = "Title here"
url = "http://www.mysite.com/url-goes-here"
cursor.execute("""INSERT INTO `videos_justicevids` (`title`, `pageurl`) VALUES (%s, %s)""",(title, url))
我没有收到错误,数据库。
I'm not getting an error, but it's not inserting into the database.
推荐答案
您需要提交。
connection.commit()
这篇关于Python MySQLdb无法插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文