, 使用fetchall() 方法获取多条数据。...2.fetchone(): 该收全部的返回结果行.
3.rowcount: 这是方法获取下一个查询结果集。...age={},sex={},income={}".format(fname, lname, age, sex, income))
except:
print("Error: unable to fecth...Mohan', 20, 'M', 2000)"""
try:
cursor.execute(sql)
# 提交到数据库执行
db.commit()
except:
# 发生错误时回滚...SEX = '{}'".format('M')
try:
cursor.execute(sql)
# 提交到数据库执行
db.commit()
except:
# 发生错误时回滚