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

 

相关文章:

  • 2021-09-29
  • 2021-07-25
  • 2022-01-31
  • 2022-12-23
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
  • 2022-01-13
  • 2022-02-26
  • 2021-09-18
相关资源
相似解决方案