Reputation: 21039
Using Flask, I'm trying to implement HTTP PATCH
. I am using SQLite.
Here's what I have:
if 'name' in data.keys():
db.execute('UPDATE places SET name=%s WHERE id=%s', (str(data['name']), str(data_id)))
This yields the following error: OperationalError: near "%": syntax error
What is wrong with my parametrisaton? I've looked up a few examples that pretty much look like this. I tried adding a % before the parameters parenthesis and that is also failing. I also tried concatenating using +
's but that also doesn't work.
Upvotes: 3
Views: 2343