I have a table with the columns value1, value2 and value3.
Every few months, all rows will need to change their 'value1' to a different value. So far I have the following code and I cannot figure out for the life of me why it is not working. Instead of only modifying column one, it generates an entire new row of information.
Thanks in advance.
INSERT INTO table (value1, value2, value3)
VALUES ('$valueForValue1', '$valueForValue2','$valueForValue3')
ON DUPLICATE KEY UPDATE
`value1`='$valueForValue1',
`value2`='$valueForValue2',
`value3`='$valueForValue3',
UPDATEstatement rather thanINSERTif you really meant all rows. Can you elaborate a little bit more on what are you trying to achieve?