#python3 #xiaodeng #基于py3和pymysql的数据库查询,查询某几列的数据 import pymysql conn=pymysql.connect(....) cur=conn.cursor() cur.execute("select name,age from nlist")
data=cur.fethall()
for name,age in data: print name,age conn.close() cur.close()
#python3 #xiaodeng #基于py3和pymysql的数据库查询,查询某几列的数据 import pymysql conn=pymysql.connect(....) cur=conn.cursor() cur.execute("select name,age from nlist")
data=cur.fethall()
for name,age in data: print name,age conn.close() cur.close()