REPLACE INTO should only be used if the data deletion is wanted.
[platal.git] / include / validations / homonymes.inc.php
index ec8e1fe..420fd65 100644 (file)
@@ -124,7 +124,9 @@ est ambigu pour des raisons d'homonymie et signalera ton email exact.";
         switch_bestalias($this->user, $this->loginbis);
         if (!$this->warning) {
             XDB::execute("UPDATE aliases SET type = 'homonyme', expire = NOW() WHERE alias = {?}", $this->loginbis);
-            XDB::execute("REPLACE INTO homonyms (homonyme_id, uid) VALUES({?}, {?})", $this->user->id(), $this->user->id());
+            XDB::execute('INSERT IGNORE INTO  homonyms (homonyme_id, uid)
+                                      VALUES  ({?}, {?})',
+                         $this->user->id(), $this->user->id());
         }
 
         return true;