]> git.mxchange.org Git - mailer.git/commitdiff
A little better SQL, but still does not calculate correctly
authorRoland Häder <roland@mxchange.org>
Wed, 24 Oct 2012 23:27:42 +0000 (23:27 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 24 Oct 2012 23:27:42 +0000 (23:27 +0000)
inc/modules/admin/what-list_user_amounts.php

index de0fdfd4464d857ae5017f07fdd864eb2a4271f2..76523825fcd3b637f400f6634316544a9959c6c9 100644 (file)
@@ -55,7 +55,7 @@ $sql = substr($sql, 0, -1);
 
 // Run the query to obtain all user's amounts (regardless of their status)
 $result = SQL_QUERY('SELECT
 
 // Run the query to obtain all user's amounts (regardless of their status)
 $result = SQL_QUERY('SELECT
-       d.`userid`,
+       p.`userid`,
        SUM(
                ' . $sql . ' -
                d.`used_points`
        SUM(
                ' . $sql . ' -
                d.`used_points`
@@ -67,9 +67,9 @@ INNER JOIN
 ON
        d.`userid`=p.`userid`
 GROUP BY
 ON
        d.`userid`=p.`userid`
 GROUP BY
-       d.`userid`
+       p.`userid`
 ORDER BY
 ORDER BY
-       d.`userid` ASC', __FILE__, __LINE__);
+       p.`userid` ASC', __FILE__, __LINE__);
 
 // Are there entries? (sorry, the XML functions cannot "produce" the above SQL statement)
 if (!SQL_HASZERONUMS($result)) {
 
 // Are there entries? (sorry, the XML functions cannot "produce" the above SQL statement)
 if (!SQL_HASZERONUMS($result)) {