为什么在检索大量数据时cursor.fetchall()返回一些随机字符?
这是我的python代码:
conn = mysql.connect()
cursor = conn.cursor()
#execute query
cursor.execute("SELECT loanID FROM lending_loandetails")
rv = cursor.fetchall()
json_data=list()
for result in rv:
json_data.append({'pnid': result[0]})
return jsonify(json_data)