본문 바로가기
Coding/Python

파이썬 pymysql fetchone()

by Hide­ 2017. 11. 9.
반응형

# Using a while loop cursor.execute("SELECT * FROM employees") row = cursor.fetchone() while row is not None: print(row) row = cursor.fetchone() # Using the cursor as iterator cursor.execute("SELECT * FROM employees") for row in cursor: print(row)