- In 1.1:
Fetch the next row of a query result set, returning a single sequence, or None if no more data is available. An exception will be raised if the previous call to execute() didn't produce a result set or execute() wasn't called before.
- In 1.0:
Fetches next row of a pending result set and returns a tuple.
import mariadb conn = mariadb.connect( host = 'localhost', user = 'root', password = 'secret', database = 'test', ) cursor = conn.cursor() cursor.execute("SELECT * FROM sample") while True: row = cursor.fetchone() if not row: break print(row)