title: "mysql.connector.errors.InternalError: Unread result found" is being produced when entering book code
body: <p>Output:</p>
  <pre><code>Welcome back  Manas . What do you want to do? 
  
  1.Add book to borrow
  2.Return book borrowed
  3.Check existing borrowed book(s)
  4.Logout
  Enter your choice: 1
  Enter code of book to be borrowedAA111
  </code></pre>
  <p>Results in:</p>
  <blockquote>
  <p>Traceback (most recent call last):   File
  &quot;C:\Users\Rotten\Desktop\test.txt&quot;, line 53, in 
  userlist(username,bookcode,bookborrowdate)   File &quot;C:\Users\Rotten\Desktop\test.txt&quot;, line 22, in userlist
  cursor.execute(&quot;insert into userlist values(%s,%s);&quot;,(username,bookdict,))   File
  &quot;C:\Users\Rotten\AppData\Local\Programs\Python\Python310\lib\site-packages\mysql\connector\cursor_cext.py&quot;,
  line 243, in execute
  self._cnx.handle_unread_result()   File &quot;C:\Users\Rotten\AppData\Local\Programs\Python\Python310\lib\site-packages\mysql\connector\connection_cext.py&quot;,
  line 794, in handle_unread_result
  raise errors.InternalError(&quot;Unread result found&quot;) mysql.connector.errors.InternalError: Unread result found</p>
  </blockquote>
  <p>Here is the minimal code sample</p>
  <pre><code>import mysql.connector
  import hashlib
  import os
  from datetime import date
  mycon=mysql.connector.connect(host=&quot;localhost&quot;,user=&quot;root&quot;,passwd=&quot;123456&quot;,database=&quot;library&quot;,charset=&quot;utf8mb4&quot;)
  cursor=mycon.cursor()
  stmt = &quot;SHOW TABLES LIKE 'users'&quot;
  cursor.execute(stmt)
  result = cursor.fetchone()
  if result:
      pass
  else:
      cursor.execute(&quot;create table userlist(username varchar(20),book varchar(200));&quot;)
  def userlist(username,bookcode,bookborrowdate):
      bookdict={}
      booktick=cursor.execute(&quot;Select book from userlist where username=%s&quot;,(username,))
      if booktick is not None:
          bookdict=booktick
      else:
          pass
      bookdict.update({'bookcode':'bookborrowdate'})
      cursor.execute(&quot;insert into userlist values(%s,%s);&quot;,(username,bookdict,))
      mycon.commit()
  def userfull(username):
      cursor.execute(&quot;select book from userlist where username=%s;&quot;,(username,))
      bookdata=cursor.fetchone()
      if bookdata is None:
          print(&quot;No books&quot;)
      else:
          bookneed=bookdata[0]
          for key, value in bookneed.items():
              print(key, ' : ', value)
  def userret(username,bookcode):
      cursor.execute(&quot;select book from userlist where username=%s;&quot;,(username,))
      bookreturn=cursor.fetchone()
      if bookreturn is None:
          print(&quot;No books borrowed&quot;)
      else:
          bookretex=bookreturn[0]
          if bookcode in bookretex:
              del bookretex[bookcode]
  username=&quot;Manas&quot;
  print(&quot;Welcome back &quot;,username,&quot;. What do you want to do? \n&quot;)
  print(&quot;1.Add book to borrow&quot;)
  print(&quot;2.Return book borrowed&quot;)
  print(&quot;3.Check existing borrowed book(s)&quot;)
  print(&quot;4.Logout&quot;)
  usch=int(input(&quot;Enter your choice: &quot;))
  if usch==1:
      while True:
          bookcode=input(&quot;Enter code of book to be borrowed&quot;)
          bookborrowdate=date.today()
          userlist(username,bookcode,bookborrowdate)
          td=timedelta(10)
          print(&quot;Please return this book by&quot;,bookborrowdate+td)
          choice=input(&quot;Continue?[y/n]&quot;)
          if choice in 'Yy':
              continue
          else:
              break
  elif usch==2:
      while True:
          bookcode=input(&quot;Enter code of borrowed book to be returned&quot;)
          returnticket=userret(username,bookcode)
          returncookie=input(&quot;continue? [y/n]: &quot;)
          if returncookie in &quot;Yy&quot;:
              continue
          else:
              break
  elif usch==3:
      userfull()
  elif usch==4:
      print(&quot;Logging out of &quot;,username,&quot;...&quot;)
      username=None
  else:
      print(&quot;Wrong input, try again&quot;)
  </code></pre>