title: raise errors.InterfaceError(ERR_NO_RESULT_TO_FETCH) mysql.connector.errors.InterfaceError: No result set to fetch from
body: <p>I'm trying to make a simple tkinter program where there's entries to put your username, email, and password and I am trying to make it check if there a username already exists and it gives me this error. I know there has been other questions about it on stackoverflow but those did not help me out.</p>
  <pre><code>
  import mysql.connector
  from tkinter import *
  
  root = Tk()
  root.title(&quot;Login&quot;)
  root.iconbitmap(&quot;profile.ico&quot;)
  
  db = mysql.connector.connect(
      db = &quot;pythonlogin&quot;,
      host=&quot;127.0.0.1&quot;,
      user=&quot;root&quot;,
      password=&quot;[password]&quot;
  )
  
  cursor = db.cursor()
  
  usernameLabel = Label(root, text='Username: ')
  emailLabel = Label(root, text='Email: ')
  passwordLabel = Label(root, text='Password: ')
  
  usernameEntry = Entry(root, width=30)
  emailEntry = Entry(root, width=30)
  passwordEntry = Entry(root, width=30)
  
  usernameLabel.grid(row=0, column=0)
  emailLabel.grid(row=1, column=0)
  passwordLabel.grid(row=2, column=0)
  
  usernameLabel.config(font=(&quot;Roboto&quot;, 12))
  emailLabel.config(font=(&quot;Roboto&quot;, 12))
  passwordLabel.config(font=(&quot;Roboto&quot;, 12))
  
  usernameEntry.grid(row=0, column=1)
  emailEntry.grid(row=1, column=1)
  passwordEntry.grid(row=2, column=1)
  
  class userInfo():
      def __init__(self, username, email, password):
          self.username = username
          self.email = email
          self.password = password
      
      def addInfoToDB(self):
          query = &quot;INSERT INTO pylogin (Username, Email, Password) VALUES (%s, %s, %s)&quot;
          values = (self.username, self.email, self.password)
          cursor.execute(query, values)
          db.commit()
          print(cursor.rowcount, &quot;record inserted.&quot;)
  
  errorLabel = Label(root)
  errorLabel.grid(row=4, column=1)
  
  def submitInfo():
      fetchInfo = cursor.fetchall()
      if usernameEntry.get() == &quot;&quot; or emailEntry.get() == &quot;&quot; or passwordEntry.get() == &quot;&quot;:
          errorLabel.config(text=&quot;Error: Couldn't get value of all entries&quot;, fg=&quot;red&quot;)
      if (usernameEntry.get(),) in fetchInfo:
          errorLabel.config(text=&quot;Username already exists in the database!&quot;)
      else:
          errorLabel.config(text=&quot;Success!&quot;, fg=&quot;green&quot;)
          details = userInfo(usernameEntry.get(), emailEntry.get(), passwordEntry.get())
          details.addInfoToDB()
  
  submitButton = Button(root, text=&quot;Submit&quot;, command=submitInfo)
  submitButton.grid(row=3, column=1, ipadx=50)
  submitButton.config(font=(&quot;Roboto&quot;, 10))
  
  root.mainloop()
  
  </code></pre>