SQL fixes for wrong column names.
authorRoland Häder <roland@mxchange.org>
Sat, 20 Mar 2010 23:34:58 +0000 (23:34 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 20 Mar 2010 23:34:58 +0000 (23:34 +0000)
inc/autopurge/purge-mails.php

index 9126d81..79fbe43 100644 (file)
@@ -98,7 +98,7 @@ FROM
 WHERE
        `timestamp_send` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?})
 ORDER BY
 WHERE
        `timestamp_send` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?})
 ORDER BY
-       `sender` ASC", __FILE__, __LINE__);
+       `userid` ASC", __FILE__, __LINE__);
 
 // Do we have "purged" mails?
 if (SQL_NUMROWS($result_mails) > 0) {
 
 // Do we have "purged" mails?
 if (SQL_NUMROWS($result_mails) > 0) {
@@ -107,21 +107,21 @@ if (SQL_NUMROWS($result_mails) > 0) {
                // Check now...
                if (!fetchUserData($content['sender'])) {
                        // Okay we found some mails!
                // Check now...
                if (!fetchUserData($content['sender'])) {
                        // Okay we found some mails!
-                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `sender`=%s",
-                               array(bigintval($content['sender'])), __FILE__, __LINE__);
+                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `userid`=%s",
+                               array(bigintval($content['userid'])), __FILE__, __LINE__);
 
                        // Get all affected (deleted) rows
                        $deletedStats += SQL_AFFECTEDROWS();
 
                        // Reset query (to prevent possible errors) ...
                        $result_mails = SQL_QUERY("SELECT
 
                        // Get all affected (deleted) rows
                        $deletedStats += SQL_AFFECTEDROWS();
 
                        // Reset query (to prevent possible errors) ...
                        $result_mails = SQL_QUERY("SELECT
-       `userid` AS sender
+       `userid` AS userid
 FROM
        `{?_MYSQL_PREFIX?}_user_stats`
 WHERE
        `timestamp_send` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?})
 ORDER BY
 FROM
        `{?_MYSQL_PREFIX?}_user_stats`
 WHERE
        `timestamp_send` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?})
 ORDER BY
-       `sender` ASC", __FILE__, __LINE__);
+       `userid` ASC", __FILE__, __LINE__);
                } // END - if
        } // END - while
 } // END - if
                } // END - if
        } // END - while
 } // END - if