Inserts records which are in $new_records, but are not in the specified table Deletes records which are in the specified table, but not in $new_records Updates records which are in both Matching is done on the 'id' field, as a result the $new_records arrays MUST contain an id field.