Fehler bei update

kandl

Grünschnabel
Hallo, bin gerade dabei einen Eintrag in meiner Datenbank "upzudaten".


PHP:
$query ="UPDATE Product SET '$key2' = 'Acer Aspire' WHERE '$key' = 'Toshiba' ";

wobei in key und key2 jeweils ProductName drinnen steht.
PHP:
$key = $_POST["key"];
und da übergebe ich aus dem html file ProductName

Bekomme immer diese Fehlermeldung.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''PName' = 'Acer Aspire' WHERE 'PName' = 'Toshiba'' at line 1

Bitte um Hilfe.
Vielen Dank,
Wolfgang
 
Zurück