I am trying to use ON DUPLICATE KEY UPDATE in PHP. I really am not sure what the correct syntax is. I am using MySQL 8.0.19
I have,
$sql = "INSERT INTO cart (title, price, productID, quantity) VALUES ('$title', '$price', '$productID', '$quantity') ON DUPLICATE KEY UPDATE quantity WHERE productID='$productID'";
And quantity is auto-increment and productID is the unique key. I want quantity to increase if the productID already exists.
I get the error,
"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 productID='1'' at line 1".