iv started using database for my program instead of .txt files and i would like to make a search function
iv got the basics of the search function ( dropdown menu with all the possible choices) but with most of the items theres multiple items in 1 column/row for example
column "food_name" " Ingredients" " recipe"
potato casserole potato,cheese,ect
but in my search function potato,cheese is 1 item how can i seprate it??
and my second question obviously theres going to be foods with similier ingredients how can i stop it from showing multiples of the same ingredient and still bring up the result of all the foods with the same ingredient??
from tkinter import *
from tkinter.ttk import Combobox
import sqlite3
con = sqlite3.connect("Food.db")
c = con.cursor()
c.execute("SELECT Ingredients FROM Dinner_Order")
order = c.fetchall()
c.execute("SELECT Ingredients FROM Dinner_Stove")
stove = c.fetchall()
c.execute("SELECT Ingredients FROM Dinner_Oven")
oven = c.fetchall()
c.execute("SELECT Ingredients FROM Dinner_Cold")
cold = c.fetchall()
c.execute("SELECT Ingredients FROM Dinner_Simple")
simple = c.fetchall()
con.commit()
dinner_order = order
dinner_stove = stove
dinner_oven = oven
dinner_cold = cold
dinner_simple = simple
ws = Tk()
ws.title("Python Guides")
ws.geometry("200x200")
item_names = dinner_order + dinner_stove + dinner_oven + dinner_simple + dinner_cold
combo = Combobox(ws, state='readonly')
combo['values'] = item_names
combo.pack()
combo = Combobox(ws, state='readonly')
combo['values'] = item_names
combo.pack()
combo = Combobox(ws, state='readonly')
combo['values'] = item_names
combo.pack()
combo = Combobox(ws, state='readonly')
combo['values'] = item_names
combo.pack()
button = Button(ws, text="search", )#command=search_items)
button.pack()
ws.mainloop()