From 24b027866273673c39da014df7d02a19997b22a1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Fri, 17 Jun 2011 23:18:24 +0200 Subject: [PATCH] No updates needed if no old pids. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/admin.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/admin.php b/modules/admin.php index 81c0182..6a61466 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -1972,10 +1972,12 @@ class AdminModule extends PLModule $pids = array_unique($new_pids); // Updates years. - XDB::execute('UPDATE profile_education - SET entry_year = {?}, grad_year = {?}, promo_year = {?} - WHERE pid IN {?} AND eduid = {?} AND degreeid = {?}', - $entry_year, $promotion, $promotion, $old_pids, $edu_id, $degree_id); + if (count($old_pids)) { + XDB::execute('UPDATE profile_education + SET entry_year = {?}, grad_year = {?}, promo_year = {?} + WHERE pid IN {?} AND eduid = {?} AND degreeid = {?}', + $entry_year, $promotion, $promotion, $old_pids, $edu_id, $degree_id); + } } // Precomputes values common to all users. -- 2.1.4