From a245a3e14efde886a8a92307c0066f2caa2d8710 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sun, 21 Nov 2010 00:01:23 +0100 Subject: [PATCH] Fixes erroneous queries. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- include/reminder.inc.php | 4 ++-- modules/profile.php | 2 +- modules/profile/jobs.inc.php | 2 +- modules/register.php | 2 +- modules/search.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) 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(); -- 2.1.4