import pymysql
zwy = pymysql.connect(host='localhost', user='root', password='123456789', db='world')
cursor = zwy.cursor()
zwy.commit()
update_sql = '''update student set sname = 'renji' where sid = %s'''
cursor.execute(update_sql, '06')
zwy.commit()
select_sql = 'select*from student'
cursor.execute(select_sql)
print(cursor.fetchall())
zwy.close()
© 版权声明
THE END
暂无评论内容