3

I have a cursor on database db like :

db = MySQLdb.connect("localhost", "user", "pass")
cursor = db.cursor()
cursor.execute(sql)
print(cursor.fetchall())
rows = cursor.fetchall()
print(rows)

Why first output is an empty tuple () while the second output lists my records correctly like : ((A,C),(B,D)) ?

alizeyn
  • 2,300
  • 1
  • 20
  • 30

0 Answers0