X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Freminder%2Fpromotion_ml.inc.php;h=8176320d54ebb70aac6d1cc3bf2b55059467fbb6;hb=ae23da1db4f36ee4a7eacc32931348a53e021517;hp=ffc33b2f38c632636ce3025de5582857ebdfe34b;hpb=cecdf74795e71ed038411915dad5e0dff6ea51fa;p=platal.git diff --git a/include/reminder/promotion_ml.inc.php b/include/reminder/promotion_ml.inc.php index ffc33b2..8176320 100644 --- a/include/reminder/promotion_ml.inc.php +++ b/include/reminder/promotion_ml.inc.php @@ -1,6 +1,6 @@ profile()->yearPromo()); - $asso_id = $res->fetchOneCell(); - XDB::execute('REPLACE INTO group_members (uid, asso_id) - VALUES ({?}, {?})', - $user->id(), $asso_id); + XDB::execute('INSERT IGNORE INTO group_members (uid, asso_id) + SELECT {?}, id + FROM groups + WHERE diminutif = {?}', + $user->id(), $user->profile()->yearPromo()); $mmlist = new MMList($user); $mmlist->subscribe('promo' . $user->profile()->yearPromo());