You're using apostrophes around a
column name and MySQL doesn't support that. For column names you need to either use no quotations, or a backtick (
`
) symbol:
WHERE 'id'= <-- wrong
WHERE id= <-- okay
WHERE `id`= <-- okay
But you also shouldn't be using string interpolation in your queries, you're opening yourself up to SQL injection attacks. Consider using
PHP: mysqli_stmt::bind_param - Manual[
^]