1

I created a tkinter connected to sqlite file, with Entries for search of workers data, for example: name, qualification, job. I need to search with more than Entry in the same time so I write for example:

c.execute("SELECT *,oid FROM data WHERE name LIKE ? and qualification LIKE ? and job LIKE ?", ('%' + self.name.get() + '%', '%' + self.qualification.get() + '%', '%' + self.job.get() + '%'))

the problem encountered me when I search by one Entry or two and leave the third Entry blank, and because the data of column for that Entry is not blank, that leads to 0 results, I thought to use "If" but that will lead to complicated code with more Entries, is there any way to solve that? thanks for help

forpas
  • 160,666
  • 10
  • 38
  • 76

0 Answers0