The error is:
sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 0, and there are 1 supplied.
And this is the code causing it:
data = c.execute('''SELECT * FROM job WHERE title LIKE "%?%"''', (user_input,)).fetchall()
For more context, I'm trying to create a functioning search bar with Python, Flask and SQlite3, where c.execute here is supposed to return the data from my database based on user input. But I'm having trouble configuring SELECT so it works with partial matches too, hence the use of LIKE. What am I doing wrong?
?doesn't create a binding. For that you want%s, but that's a little awkward here because of the%in the syntax of the LIKE operator. For ways to solve that, see: stackoverflow.com/a/3134756/765091. Don't use insecure string manipulation as suggested in your answer.