31.07.2018, 09:10
IGNORE + checking affected rows basically does this: inserts a new row or updates a record if all is good but if an error occurs, it will hide the error (ignore) and affected rows will be 0. This way, you don't have to execute a SELECT query just to see if there is a match (same number phone) as UNIQUE KEY will return error if there will be duplicates.