X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Freminder.inc.php;h=5201c8d442d886452c0a424cb7db45d2f42991b9;hb=00ba8a742be0cfc70eef7c6aaaccebe7134ec087;hp=715d2d541747d72533d5604f4c35ddac051cfd09;hpb=abd508e0a9df441fa1dac740013c8e2ab09d54cc;p=platal.git diff --git a/include/reminder.inc.php b/include/reminder.inc.php index 715d2d5..5201c8d 100644 --- a/include/reminder.inc.php +++ b/include/reminder.inc.php @@ -71,9 +71,9 @@ abstract class Reminder // and the next ask (if any). private static function UpdateStatus($uid, $type_id, $status, $next_ask) { - XDB::execute('REPLACE INTO reminder - SET uid = {?}, type_id = {?}, status = {?}, - remind_last = NOW(), remind_next = FROM_UNIXTIME({?})', + XDB::execute('INSERT INTO reminder (uid, type_id, status, remind_last, remind_next) + VALUES ({?}, {?}, {?}, {?}, {?}) + ON DUPLICATE KEY UPDATE status = VALUES(status), remind_last = NOW(), remind_next = VALUES(remind_next)', $uid, $type_id, $status, ($next_ask > 0 ? time() + $next_ask * 24 * 60 * 60 : null)); }