You cannot have a WHERE
clause in a basic INSERT
syntax. What you really want, i think, is an UPDATE
statement,
UPDATE cafes SET deal="$deal" WHERE id = $id
As a sidenote, the query is vulnerable with SQL Injection
if the value(s) of the variables came from the outside. Please take a look at the article below to learn how to prevent from it. By using PreparedStatements
you can get rid of using single quotes around values.