Skip to main content
 首页 » 编程设计

Python MySQLdb 无法插入

2025年05月04日31mq0036

我在努力

title = "Title here" 
url = "http://www.mysite.com/url-goes-here" 
 
cursor.execute("""INSERT INTO `videos_justicevids` (`title`, `pageurl`) VALUES (%s, %s)""",(title, url)) 

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

请您参考如下方法:

你需要提交它。

connection.commit()