When using insert... on duplicate key update, what is the syntax to update multiple columns?
INSERT INTO table1 (col1, col2, col3, col4) VALUES (’$val1’, ‘$val2’, ‘$val3’, ‘$val4’)
ON DUPLICATE KEY UPDATE col2=‘$val2’, col3=‘$val3’, col4=‘$val4’ // <-- not sure
Update: I am using this within PHP. Since this is a syntax question, it very relevant.
$result = mysql_query("INSERT INTO table1 (col1, col2, col3, col4)
VALUES (’$val1’, ‘$val2’, ‘$val3’, ‘$val4’)
ON DUPLICATE KEY UPDATE (col2=‘$val2’, col3=‘$val3’, col4=‘$val4’)")
Again, not sure about this last part with the "Update".