From: Stéphane Jacob Date: Sat, 20 Nov 2010 23:01:23 +0000 (+0100) Subject: Fixes erroneous queries. X-Git-Tag: xorg/1.0.2~135 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=a245a3e14efde886a8a92307c0066f2caa2d8710;p=platal.git Fixes erroneous queries. Signed-off-by: Stéphane Jacob --- diff --git a/include/reminder.inc.php b/include/reminder.inc.php index 5201c8d..9cf399d 100644 --- a/include/reminder.inc.php +++ b/include/reminder.inc.php @@ -72,8 +72,8 @@ abstract class Reminder private static function UpdateStatus($uid, $type_id, $status, $next_ask) { 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)', + VALUES ({?}, {?}, {?}, NOW(), {?}) + ON DUPLICATE KEY UPDATE status = VALUES(status), remind_last = VALUES(remind_last), remind_next = VALUES(remind_next)', $uid, $type_id, $status, ($next_ask > 0 ? time() + $next_ask * 24 * 60 * 60 : null)); } diff --git a/modules/profile.php b/modules/profile.php index 7392d5a..f9b08fa 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -609,7 +609,7 @@ class ProfileModule extends PLModule } XDB::query('INSERT INTO search_autocomplete (name, query, result, generated) VALUES ({?}, {?}, {?}, NOW()) - ON DUPLICATE KEY result = VALUES(result), generated = NOW()', + ON DUPLICATE KEY UPDATE result = VALUES(result), generated = VALUES(generated)', $type, $q_normalized, $res); echo $res; exit(); diff --git a/modules/profile/jobs.inc.php b/modules/profile/jobs.inc.php index 760ab35..723370b 100644 --- a/modules/profile/jobs.inc.php +++ b/modules/profile/jobs.inc.php @@ -326,7 +326,7 @@ class ProfileSettingCorps implements ProfileSetting { XDB::execute('INSERT INTO profile_corps (original_corpsid, current_corpsid, rankid, corps_pub, pid) VALUES ({?}, {?}, {?}, {?}, {?}) - ON DUPLICATE KEY UPDATE original_corpsid = VALUES(original_corpsid), current_corpsid = VALUES(current_corpsid) + ON DUPLICATE KEY UPDATE original_corpsid = VALUES(original_corpsid), current_corpsid = VALUES(current_corpsid), rankid = VALUES(rankid), corps_pub = VALUES(corps_pub)', $value['original'], $value['current'], $value['rank'], $value['pub'], $page->pid()); } diff --git a/modules/register.php b/modules/register.php index c53a456..82703f1 100644 --- a/modules/register.php +++ b/modules/register.php @@ -71,7 +71,7 @@ class RegisterModule extends PLModule SELECT m.uid, m.sender, 0 FROM register_marketing AS m WHERE m.hash - ON DUPLICATE KEY sender = VALUES(sender), success = VALUES(success)', + ON DUPLICATE KEY UPDATE sender = VALUES(sender), success = VALUES(success)', $subState->s('hash')); } } diff --git a/modules/search.php b/modules/search.php index 6a2a1e3..358db58 100644 --- a/modules/search.php +++ b/modules/search.php @@ -268,7 +268,7 @@ class SearchModule extends PLModule } XDB::query('INSERT INTO search_autocomplete (name, query, result, generated) VALUES ({?}, {?}, {?}, NOW()) - ON DUPLICATE KEY result = VALUES(result), generated = NOW()', + ON DUPLICATE KEY UPDATE result = VALUES(result), generated = VALUES(generated)', $type, $q, $res); echo $res; exit();