Skip to content

PHP Develop

Blog about PHP development

Tag: update

MySQL insert or update if exists in one query

INSERT INTO `table` (`id`, `field_1`, `field_2`) VALUES(1, "value1", "value2") ON DUPLICATE KEY UPDATE
 `field_1`="value1", `field_2`="value2"
Author fububy@gmail.comPosted on 4th March 2016Categories DatabasesTags insert, mysql, updateLeave a comment on MySQL insert or update if exists in one query

cmu.edu

PHP Develop Proudly powered by WordPress