My query is working fine in SQL using this
UPDATE productcolor
SET colorName = CASE productcolorID
WHEN 341 THEN 'BLACK'
WHEN 342 THEN 'RED'
END
WHERE productinformationID IN (50)
But now i want to transfer it to PDO this is my first time using case in PDO.. So far this is my syntax
$stmt = $db->prepare('UPDATE productcolor
SET colorName = CASE productcolorID
WHEN :producolorID THEN :colorName
END
WHERE productinformationID IN (:productinformationID)');
$stmt->execute(array(
':colorName' => $savecolor,
':productcolorID' => $testID,
':productinformationID' => $prodID));
Can someone correct my syntax? Thank you!