I don't know the proper term, but by "Batch insert" what I mean is..
INSERT INTO `table` (`column1`, `column2`, `column3`) VALUES
("value1", "value2", "value3"),
("value4", "value5", "value6"),
("value7", "value8", "value9")
We're inserting multiple rows in a single query to save resources.
We have a composite key set up on this table to avoid getting duplicate records. Problem is, when there is a duplicate record, it rejects the entire "batch", so in the example above, if "value1" already existed in the column1
column, it will not insert any of the 3 rows.
We are using PHP with the mysql_ functions (yes, I know they're being deprecated, let's address one problem at a time please)
So my question is, is there a way to insert multiple rows at once where, in the event of a duplicate row, it will still insert the rest of the rows in the "batch"?
Thanks for your help.