python + mysql 实现表删除数据
实例如下:
import pymysql
def Delete_From():
#打开数据库链接
db = pymysql.connect("localhost","root","123456","test")
# 使用cursor()方法获取操作游标
cursor = db.cursor()
# SQL语句更新数据
sql = """DELETE FROM student WHERE ID = %s"""%(3)
try:
#
转载
2021-11-23 11:23:01 ·
1646 阅读 ·
0 评论