Reputation: 25
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 'WHERE `id_product` = 9' at line 1
UPDATE `ps_product` SET `price` = WHERE `id_product` = 9
Upvotes: 0
Views: 62
Reputation: 2984
The Problem in your query is that you have "price
= WHERE ". As you didnt paste your whole code there I guess that the variable which holds the value with to which Price shall be set is empty.
Thus you should control that variable and see why it is empty (in case the whole query is a string with no variables involved then you forgot the value to which Price shall be set).
If Price is meant to be empty you will have to set it to an empty value via either using ='', =null or =0 depending on what empty is represented by the field (and its type).
Upvotes: 1
Reputation: 4650
You need to pass empty value with in single or double quotes or any values
UPDATE `ps_product` SET `price` = '' WHERE `id_product` = 9
Upvotes: 1
Reputation: 69505
The value for price is missing in your sql:
UPDATE `ps_product` SET `price` = WHERE `id_product` = 9
^^^^
Upvotes: 1