title: Not Working filter search using python and mysql
body: <p>It is showing me no record after writing the 1. I have data on my database for 1. Can someone please help me to know where I am wrong here?</p>
  <pre><code>    def searchDB():
          try:
             sqlCon = mysql.connect(host=&quot;localhost&quot;,user=&quot;root&quot;,password=&quot;*********&quot;,database=&quot;mydatabase&quot;) 
             cur =sqlCon.cursor ()
             cur.execute (&quot;select categoryname from category where &quot;+ str(searchby.get())+ &quot;Like '%&quot; + str(search.get()) + &quot;Like '%'&quot;)
             result = cur.fetchall ()
             if len(result) !=0:
                self.category_records.delete(*self.category_records.get_children())
                for row in result:
                    self.category_records.insert('',END,values =row)
             sqlCon.commit()
             sqlCon.close()
            
       
          except:
             tkinter.messagebox.showinfo(&quot;Data Search Form&quot;, &quot;No such record Found&quot;)
             Reset()
  
          sqlCon.close()
  
  
        
  </code></pre>