IvyChou
0
Q:

sqlite3.OperationalError: near "WHERE": syntax error

cur.execute('INSERT INTO "{}" VALUES(?, ?)'.format(group.replace('"', '""')), (food, 1))
0
cur.execute('SELECT COUNT(Name) FROM "{}" WHERE Name=?'.format(group.replace('"', '""')), (food,))
-1
In [156]: sql
Out[156]: "update foo set is_processed=1 where bar='don't look now'"
0
there shoudnt be a comma on the line before the WHERE clause ;)
0
cur.execute('UPDATE "{}" SET Times=? WHERE Name=?'.format(group.replace('"', '""')),
            (times_before + 1, food))
0

New to Communities?

Join the community