Why would mysql execute return None?

I am trying to query a local MySQL database using Python’s (3.4) MySQL module with the following code:

class databases():

  def externaldatabase(self):

    c = mysql.connector.connect(host="", user="user",
                                password="password", database="database")
     if c.is_connected():
           c.autocommit = True
    d = databases().externaldatabase()
    c = d.cursor() 
    r = c.execute('''select * from tbl_wiki''')
> Returns: None

As far as I can tell, the connection is successfull, the database is composed of several rows but the query always returns the none type.

What instances does the MySQL execute function return None?

Source: sql

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.