X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Faxletter.php;h=b0f654e94f6d437fea0f005a6a3e4f9832e20bd9;hb=00ba8a742be0cfc70eef7c6aaaccebe7134ec087;hp=d08b0bc82dfe902d34e1ef1a5463d3bb90018dc4;hpb=abd508e0a9df441fa1dac740013c8e2ab09d54cc;p=platal.git diff --git a/modules/axletter.php b/modules/axletter.php index d08b0bc..b0f654e 100644 --- a/modules/axletter.php +++ b/modules/axletter.php @@ -188,10 +188,15 @@ class AXLetterModule extends PLModule break; case 'Confirmer': - XDB::execute("REPLACE INTO axletter - SET id = {?}, short_name = {?}, subject = {?}, title = {?}, body = {?}, - signature = {?}, promo_min = {?}, promo_max = {?}, echeance = {?}, subset = {?}, subset_rm = {?}", - $id, $short_name, $subject, $title, $body, $signature, $promo_min, $promo_max, $echeance, $subset ? implode("\n", $subset_to) : null, $subset_rm); + XDB::execute('INSERT INTO axletter (id, short_name, subject, title, body, signature, + promo_min, promo_max, echeance, subset, subset_rm) + VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}) + ON DUPLICATE KEY UPDATE short_name = VALUES(short_name), subject = VALUES(subject), title = VALUES(title), + body = VALUES(body), signature = VALUES(signature), promo_min = VALUES(promo_min), + promo_max = VALUES(promo_max), echeance = VALUES(echeance), subset = VALUES(subset), + subset_rm = VALUES(subset_rm)', + $id, $short_name, $subject, $title, $body, $signature, $promo_min, $promo_max, $echeance, + $subset ? implode("\n", $subset_to) : null, $subset_rm); if (!$saved) { global $globals; $mailer = new PlMailer();