I have a "user" table that contains id (PK, auto_increment), name, email (unique), cpf (unique), among other fields less important now. To add a user, I have data of all these tables mentioned but, obviously, id. CPF is a kind of Brazilian identity document.
I need to add a user if it doesn't exist on my table, and I can't overwrite. I googled, and discovered about the INSERT IGNORE. But how could this know that a user exists or not if I don't have the id, and this is my only primary key? How could I "teach" to the INSERT that these unique fields also can be compared?
Thanks!