问题
I'm trying
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.
回答1:
You need to commit it.
connection.commit()
来源:https://stackoverflow.com/questions/12984607/python-mysqldb-failing-to-insert