Im currently inserting a large amount (100k+) of rows into a table as follows:
//START of a loop
$updatedData[] = '(
"'.$field_1.'",
"'.$field_2.'",
"'.$field_3.'"
)';
//END of loop
$updatedData = implode(',', $updatedData);
$query = "INSERT INTO table (field_1,field_2,field_3) VALUES $updatedData";
This is all working perfectly, but now I'm looking for a way to update a row instead of insert a new one if $field_1 and $field_3 are duplicates.
TRACKINGtable.ON DUPLICATE KEYis based on the primary key