Python MySQLdb failing to insert

2019-04-14 19:47发布

问题:

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()


标签: python cursor