i have created smple pyqt6 application, which looks like this :
so i have product database and i want to write a product from input panel and python should search product in database, for this one i have added following line to pyqt6 application :
def clickMethod(self):
product =self.line.text()
df = pd.read_sql_query('select * from "foreign_products"', con=engine)
print(df.head())
here question is how to add product in read_sql_quary commend? after i bit research , i found following solution for strings :
df = pd.read_sql_query('''SELECT * FROM "Prices" where "Type" = 'Daily'
''', conn)
but what about customer based string?based on my previous question, i got following solution :
curr.execute("""
INSERT INTO message_sentiment(mytext,text_label,score)
VALUES (%s, %s, %s);
""",
(text,label, score))
how can i combine this solution with my task? thanks in advance