I want the program to look for keywords in the input and if it is the same as one in the names table then it will search for the solutions with that specific name. I want the FROM to be x[space] as that would be the variable with the correct name e.g sound.
issue = input("BOT: Hello, please specify your issue\nType here: ")
issue = issue.lower()
x = issue.split(" ")
c.execute("""SELECT Names FROM names""")
prob = c.fetchall()
conn.commit()
prob = str(prob)
prob = prob.split(" ")
space = 0
space1 = 0
right = False
while space < len(x) and right == False:
if x[space] == prob[space1]:
c.execute("""SELECT solutions FROM ?""",x[space])
do = c.fetchall()
conn.commit()
the error I got:
Traceback (most recent call last): File "/Users/nikkiclarke/Request bot/request code.py", line 272, in c.execute("""SELECT solutions FROM ?""",x[space]) sqlite3.OperationalError: near "?": syntax error