import pymysql
from pymysql.cursors import DictCursor
connect = pymysql.connect(
host='127.0.0.1',
port=3306,
db='dbname',
user='root',
passwd='',
charset='utf8'
)
cursor = connect.cursor(DictCursor)
import pymysql
from pymysql.cursors import DictCursor
connect = pymysql.connect(
host='127.0.0.1',
port=3306,
db='dbname',
user='root',
passwd='',
charset='utf8'
)
cursor = connect.cursor(DictCursor)
本文标题:pymysql fetchall 查询结果返回字典
本文链接:https://www.haomeiwen.com/subject/knuatctx.html
网友评论