为何打印出来是-1啊。。。。。好郁闷
#coding:gbk
import mysql.connector
conn=mysql.connector.connect(user='root',password='hyk2320853',database='imooc',charset='utf8')
cursor=conn.cursor()
print(conn)
sql="select * from user"
cursor.execute(sql)
print(cursor.rowcount)
print(cursor)
rs=cursor.fetchone()
print(rs)
rs=cursor.fetchmany(3)
print(rs)
rs=cursor.fetchall()
print(rs)
cursor.close()
conn.close()
'''
print(cursor.rowcount)
放在sql="select * from user"
cursor.execute(sql)打印出来是-1
但是放在最后却打印出来是11
为何,和老师讲的不一样。
'''