title: How do I put data from sql database into a combobox in tkinter in python?
body: <p><a href="https://i.stack.imgur.com/yxKlQ.png" rel="nofollow noreferrer">This is the database I want to call from</a>
  <a href="https://i.stack.imgur.com/lDdOs.png" rel="nofollow noreferrer">This is the empty combobox, When I press down nothing comes up</a></p>
  <pre><code>          Label(self.root,
            text=&quot;Supplier&quot;,
            font=(&quot;Bahnschrift SemiBold&quot;,15),
            bg=&quot;blue&quot;,
            fg=&quot;white&quot;).place(x=0, y=325, height=40) 
            
          Supplier=ttk.Combobox(self.root,
                            postcommand=self.combo,
                            state=&quot;readonly&quot;,
                            font=(&quot;Bahnschrift SemiBold&quot;,15)).place(x=80, y=325, width=420, height=40
  
  def add(self):
      con=sqlite3.connect(database=&quot;product.db&quot;)
      cur=con.cursor()
      try:
          if self.pid.get()==&quot;&quot;:messagebox.showerror(&quot;Error&quot;,&quot;Product ID is required&quot;,parent=self.root)
          else:
              cur.execute(&quot;Select * from product where pid=?&quot;,(self.pid.get(),))
              row=cur.fetchone()
              if row!=None:
                  messagebox.showerror(&quot;Error&quot;,&quot;This Product ID is already assigned&quot;,parent=self.root)
              else:
                  cur.execute(&quot;Insert into product(pid,name,supplier,price,quantity,description,total)values(?,?,?,?,?,?,?)&quot;,(
                      self.pid.get(),
                      self.name.get(),
                      self.supplier.get(),
                      self.price.get(),
                      self.quantity.get(),
                      self.description.get(),
                      self.price.get()*self.quantity.get(),
                      ))
  
                  con.commit()
                  messagebox.showinfo(&quot;Success&quot;,&quot;Product added successfully&quot;,parent=self.root)
                  
      except Exception as e:
          messagebox.showerror(&quot;Error&quot;,f&quot;Error due to: {str(e)}&quot;,parent=self.root) ##
  
  
  
  def combo(self):
      conn=sqlite3.connect(&quot;supplier.db&quot;)
      c = conn.cursor()
      c.execute(&quot;SELECT name FROM supplier&quot;)
      slist = c.fetchall()
      values = [row[0] for row in slist]
      self.supplier
      con.commit()
      con.close()
  
  if __name__==&quot;__main__&quot;:
  root=Tk()
  obj=productClass(root)
  root.mainloop()
  </code></pre>
  <p>I want to populate the combo box with results found in a database. Then add the results from this into a new database.</p>
  <p>Also a different question how can I call to a database and compare the results to the user input. I want to do this to make a login system. I already have the register part but I'm confused on how to call and compare to the database.</p>
  <p>Hopefully this question isn't to hard.</p>
  <p>**No error now comes up but no results from the database is showing up on the combo box.</p>
  <p>Error:
  AttributeError: 'StringVar' object has no attribute 'configure'</p>