You're using the wrong type of quotes in your SQL. To escape a table or column name that contains a reserved word, you use backticks. And if you're using bind_param
, you have to put ?
in the query where the parameter will be substituted.
$sql = "DELETE FROM mytable WHERE `index` = ?";