cursor.description will give you a tuple of tuples where [0] for each is the column header.
num_fields = len(cursor.description)
field_names = [i[0] for i in cursor.description]
More Related Contents:
- Installing specific package version with pip
- Database does not update automatically with MySQL and Python
- mysql-python install error: Cannot open include file ‘config-win.h’
- How to insert pandas dataframe via mysqldb into database?
- Install mysql-python (Windows)
- When to close cursors using MySQLdb
- Python MYSQL update statement
- Python 3.4.0 with MySQL database
- How can I use executemany to insert into MySQL a list of dictionaries in Python
- ImportError: No module named MySQLdb
- Print the actual query MySQLdb runs?
- Can’t install mysql-python (newer versions) in Windows
- Dynamic SQL Queries with Python and mySQL
- What’s the difference between MySQLdb, mysqlclient and MySQL connector/Python?
- How to use python mysqldb to insert many rows at once
- ‘pip install MySQL-python’ fails with ‘IndexError’
- What is PyMySQL and how does it differ from MySQLdb? Can it affect Django deployment?
- How to disable query cache with mysql.connector
- pip install mysql-python fails with EnvironmentError: mysql_config not found
- Lost connection to MySQL server during query
- Does Python support MySQL prepared statements?
- How do I get the “id” after INSERT into MySQL database with Python?
- Cannot return results from stored procedure using Python cursor
- How to retrieve SQL result column value using column name in Python?
- Python and MySQLdb: substitution of table resulting in syntax error
- Bulk insert with SQLAlchemy ORM
- RuntimeError: working outside of application context
- cursor.fetchall() vs list(cursor) in Python
- How do i cast char to integer while querying in django ORM?
- flake8 complains on boolean comparison “==” in filter clause