当前位置:Gxlcms > 数据库问题 > 基于py3和pymysql的数据库查询,查询某几列的数据

基于py3和pymysql的数据库查询,查询某几列的数据

时间:2021-07-01 10:21:17 帮助过:2人阅读

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()

 

基于py3和pymysql的数据库查询,查询某几列的数据

标签:

人气教程排行