mysql中将数据库返回结果转为dict
结果:(1, ‘11‘)
self.conn = pymysql.connect( host=‘xxx‘, port=3806, user=‘root‘, passwd=str(123456), db = ‘test‘, charset = "utf8")
结果:{‘id‘: 1, ‘name‘: ‘11‘}
self.conn = pymysql.connect(
host=‘xxx‘, port=3806, user=‘root‘, passwd=str(123456), db = ‘test‘, charset = "utf8", cursorclass=pymysql.cursors.DictCursor)
相关推荐
emmm00 2020-11-17
王艺强 2020-11-17
aydh 2020-11-12
世樹 2020-11-11
zry 2020-11-11
URML 2020-11-11
spurity 2020-11-10
yifangs 2020-10-13
Andrea0 2020-09-18
Ida 2020-09-16
ltd00 2020-09-12
tufeiax 2020-09-03
xjd0 2020-09-10
greatboylc 2020-09-10
adsadadaddadasda 2020-09-08
疯狂老司机 2020-09-08
CoderToy 2020-11-16
ribavnu 2020-11-16
bianruifeng 2020-11-16