From edf5e97934d710662babb5de5dd720519fb12e98 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Mon, 5 Jul 2010 17:16:27 +0200 Subject: [PATCH] Fixes some sql errors. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/register/register.inc.php | 4 ++-- modules/stats.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/register/register.inc.php b/modules/register/register.inc.php index afe8d97..4da836b 100644 --- a/modules/register/register.inc.php +++ b/modules/register/register.inc.php @@ -152,9 +152,9 @@ function createAliases(&$subState) SET expire = ADDDATE(NOW(), INTERVAL 1 MONTH) WHERE alias = {?}', $emailXorg); XDB::execute('REPLACE INTO homonyms (homonyme_id, uid) - VALUES ({?}, {?})', $h_id, $h_id); + VALUES ({?}, {?})', $subState->i('uid'), $h_id); XDB::execute('REPLACE INTO homonyms (homonyme_id, uid) - VALUES ({?}, {?})', $h_id, $uid); + VALUES ({?}, {?})', $h_id, $subState->i('uid')); $res = XDB::query('SELECT alias FROM aliases WHERE uid = {?} AND expire IS NULL', $h_id); diff --git a/modules/stats.php b/modules/stats.php index 24863ae..d931031 100644 --- a/modules/stats.php +++ b/modules/stats.php @@ -65,9 +65,9 @@ class StatsModule extends PLModule $res = XDB::iterRow('SELECT IF(registration_date > DATE_SUB(NOW(), INTERVAL {?} DAY), TO_DAYS(registration_date) - TO_DAYS(NOW()), -{?}) AS jour, - COUNT(uid) AS nb + COUNT(a.uid) AS nb FROM accounts AS a - LEFT JOIN account_profiles AS ap ON(ap.uid = a.uid AND FIND_IN_SET(\'owner\', ap.flags)) + LEFT JOIN account_profiles AS ap ON (ap.uid = a.uid AND FIND_IN_SET(\'owner\', ap.perms)) LEFT JOIN profiles AS p ON (ap.pid = p.pid) WHERE state = \'active\' AND p.deathdate IS NULL GROUP BY jour', (int)$jours, 1 + (int)$jours); -- 2.1.4