根据字段名修改其他数据

"""
author:张鑫
date:2021/7/23 17:16
"""
"""
author:张鑫
date:2021/7/20 10:00
"""
import pymysql

connect = pymysql.Connect(
host='192.168.1.117',
port=3306,
user='root',
passwd='123456',
db='game',
charset='utf8mb4'
)
cursor = connect.cursor()
sql = 'update kasaer set age=18,score=18 where name="路明非"'
cursor.execute(sql)
connect.commit()
print('修改成功')
data=cursor.fetchall()
print(data)
connect.close()

posted @ 2021-10-20 16:18  布都御魂  阅读(34)  评论(0编辑  收藏  举报