title: Didn't get values from mysql when more than one data frame inserting in python
body: <p>I am trying to read xlsx file from unread mail and convert it  to data frame finally it will insert into MySQL DB.To avoid duplication while inserting each row of data frame i check if the data already present in db,for this duplication i check mails one by one.</p>
  
  <p>My issue is when two or more unread mail is present in inbox this duplication check fails.</p>
  
  <pre><code>detach_dir = os.path.dirname(os.path.abspath(__file__)) + 
  '/attachments'
  user = "abc@outlook.in"
  pwd = "xyz@123*"
  
  
  m = imaplib.IMAP4_SSL("outlook.office365.com")
  m.login(user,pwd)
  
  # Select the mailbox
  m.select("folder name in mail")
  n = 0
  
  resp, items = m.search(None, '(UNSEEN)')
  items = items[0].split()
  for emailid in items:
      resp, data = m.fetch(emailid, "(RFC822)")
      email_body = data[0][1]
      mail = email.message_from_bytes(email_body)
  
      if mail.get_content_maintype() != 'multipart':
          continue
  
      att_path = os.path.join(detach_dir, filename)
  
      if not os.path.isfile(att_path) :
              fp = open(att_path, 'wb')
              fp.write(part.get_payload(decode=True))
              fp.close()
  
       df_mail = pd.read_excel(att_path,skiprows= 
     [0,2,3,4,5,6,7,8,9],skip_blank_lines=True,skipfooter=1,index=False)
       df_mail = df_mail.fillna(0)
       df_mail.dropna(how="all", inplace=True)
  
       for i, row in df_mail.iterrows():
           sql = 'SELECT * FROM `tablename WHERE condition for duplicate'
           extist=con.execute(sql)
  
           duplicate=extist.fetchall()
  
           if len(duplicate) == 0:
  
               df_mail.iloc[i:i+1].to_sql('table', con = engine, if_exists = 'append', chunksize = 1000,index=False)
  
           else:
              print("duplicate data")
  </code></pre>