tu masz napisane jak to dziala:
Cytat
If you specify ON DUPLICATE KEY UPDATE, and a row is inserted that would cause a duplicate value in a UNIQUE index or PRIMARY KEY, an UPDATE of the old row is performed. For example, if column a is declared as UNIQUE and contains the value 1, the following two statements have identical effect:
czyli jak insert rzuci ci tekstem, ze dane sie duplikują (jakis UNIQ ci wyskoczy) to poleci update. to nie musi byc primary key. moze byc uniq