Hello Im getting the following error when trying to update my database:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column ''1'' in 'where clause''
Im getting three variables via POST They are:
a) the Column I want to change
b) The new value for the column
c) the ID which row to change...
Im using PDO, this is my Query with param-binding and execution:
$stmt = $db->prepare('UPDATE `artists` SET `:spalte` = `:wert` WHERE `id` = `:pk` ');
$stmt->bindParam(':spalte', $name);
$stmt->bindParam(':wert', $value);
$stmt->bindParam(':pk', $pk);
$stmt->execute();
I hope someone will understand this error...
Best Regards
Dave