时间:2021-07-01 10:21:17 帮助过:11人阅读
5.关于select
1 #_author_:LiZeBo 2 #date: 2017/11/5 0005 3 4 import pymysql 5 6 con=pymysql.connect(host=‘localhost‘,port=3306,database=‘test‘, user=‘root‘,password=‘1234‘,charset=‘utf8‘) 7 8 curor=con.cursor() 9 10 returns=curor.execute(‘select * from userinfo ‘) 11 con.commit() 12 #如果是select,这里就要使用curor的fetchall,fetchone,fetchmany进行打查询;其他的增加,删除,修改都一样,只是select 比较 13 #特殊 14 curor.close() 15 con.close() 16 print(curor.fetchone()) 17 print(curor.fetchmany(3)) 18 print(curor.fetchall())View Code
mysql的复杂查询,连接数据库
标签:本地 ted ble == ret 安装 .exe creat open