1. 首页
  2. 数据库
  3. 其它
  4. 【MySQL与python交互】06 数据库查询操作

【MySQL与python交互】06 数据库查询操作

上传者: 2020-12-22 21:32:32上传 PDF文件 24.56KB 热度 25次
""" fetchone() 功能:获取下一个查询结果集,结果集是一个对象 fetchall() 功能:接收全部的返回的行 rowcount:是一个只读属性,返回excute()方法影响的行数 """ import pymysql db = pymysql.connect('本机ip', 'root', 'root', 'aimei') # 创建一个cursor对象 cursor = db.cursor() sql = 'select * from bandcard where money>400' try: cursor.execute(sql) reslist = curs
下载地址
用户评论