fieldcount()

Overview

In 1.1:

Not present

In 1.0:

Returns the number of fields (columns) of a result set.

See also: MariaDB Connector/Python 1.1 and in 1.0

EXAMPLES

import mariadb

conn = mariadb.connect(
    host = 'localhost',
    user = 'root',
    password = 'secret',
    database = 'test',
    )

cursor = conn.cursor()

cursor.execute("SELECT * FROM sample")
print(cursor.fieldcount) # Prints the number of columns per row

CHANGE HISTORY

Release Series

History

1.1

  • Not present.

1.0

  • Present starting in MariaDB Connector/Python 1.0.0.