X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fcarnet.php;h=9454062743ccdbaee8aea26492a98f1193ff7fe1;hb=00ba8a742be0cfc70eef7c6aaaccebe7134ec087;hp=33c750a640c13e2347cb6faeef1a857332911521;hpb=abd508e0a9df441fa1dac740013c8e2ab09d54cc;p=platal.git diff --git a/modules/carnet.php b/modules/carnet.php index 33c750a..9454062 100644 --- a/modules/carnet.php +++ b/modules/carnet.php @@ -292,9 +292,10 @@ class CarnetModule extends PLModule case 'ajouter': if (($contact = User::get(Env::v('user')))) { - if (XDB::execute("REPLACE INTO contacts (uid, contact) - VALUES ({?}, {?})", - $uid, $contact->id())) { + XDB::execute('INSERT IGNORE INTO contacts (uid, contact) + VALUES ({?}, {?})', + $uid, $contact->id()); + if (XDB::affectedRows() > 0) { Platal::session()->updateNbNotifs(); $page->trigSuccess('Contact ajouté !'); } else {