The error itself clears the confusion,
SQL logic error incomplete input. Did you try to quote the variables in your content? As far as I know, SQL requires that you use string quotation around the data, like,
... WHERE data = 'something'
Any SQL guru can correct me if I am wrong here. So, it might be that your query is incomplete and causing this issue.
Lastly, do not use concatenation in SQL queries as this exposes the queries to SQL Injection, always consider using parameters to pass the input to queries. You are already doing that in the UPDATE query, but
incompletely.
SQL injection - Wikipedia[
^]