import pymysql
ecshop=pymysql.connect('localhost','root','root','ecshop')
curs=ecshop.cursor()
sql="update ecs_user_address set tel='19945020111' where consignee='an' and email='8998@qq.com'"
try:
curs.execute(sql)
ecshop.commit()
except:
conn.rollback() #发生错误时回滚
print('update wrong')
ecshop.close()