]> git.mxchange.org Git - mailer.git/blobdiff - inc/purge/purge-mails.php
Disallow subtraction on unsigned columns:
[mailer.git] / inc / purge / purge-mails.php
index e3c41d4435055b0abde65baf6d4d92a2f5ab6ec8..97716c2df331236723393d7c03a80a79a0ea4924 100644 (file)
@@ -47,7 +47,7 @@ if ((!isExtensionActive('autopurge')) || (!isAutoPurgingActive()) || (getConfig(
 } // END - if
 
 // Okay, let's check for deleted mails
-$result_mails = SQL_QUERY("SELECT
+$result_mails = sqlQuery("SELECT
        `sender`
 FROM
        `{?_MYSQL_PREFIX?}_pool`
@@ -61,26 +61,26 @@ ORDER BY
 $deletedStats = '0';
 
 // Is there "purged" mails?
-if (!SQL_HASZERONUMS($result_mails)) {
+if (!ifSqlHasZeroNums($result_mails)) {
        // Okay, check for their sender's
-       while ($content = SQL_FETCHARRAY($result_mails)) {
+       while ($content = sqlFetchArray($result_mails)) {
                // Check now...
                if (!fetchUserData($content['sender'])) {
                        // Okay we found some mails!
-                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_pool` WHERE `sender`=%s",
+                       sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_pool` WHERE `sender`=%s",
                                array(bigintval($content['sender'])), __FILE__, __LINE__);
 
                        // Get all affected (deleted) rows
-                       $deletedStats += SQL_AFFECTEDROWS();
+                       $deletedStats += sqlAffectedRows();
                } // END - if
        } // END - while
 } // END - if
 
 // Free memory
-SQL_FREERESULT($result_mails);
+sqlFreeResult($result_mails);
 
 // Now let's check for stats entries as well;
-$result_mails = SQL_QUERY("SELECT
+$result_mails = sqlQuery("SELECT
        `userid` AS `sender`
 FROM
        `{?_MYSQL_PREFIX?}_user_stats`
@@ -90,20 +90,20 @@ ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
 // Is there "purged" mails?
-if (!SQL_HASZERONUMS($result_mails)) {
+if (!ifSqlHasZeroNums($result_mails)) {
        // Okay, check for their sender's
-       while ($content = SQL_FETCHARRAY($result_mails)) {
+       while ($content = sqlFetchArray($result_mails)) {
                // Check now...
                if (!fetchUserData($content['sender'])) {
                        // Okay we found some mails!
-                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `userid`=%s",
+                       sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `userid`=%s",
                                array(bigintval($content['sender'])), __FILE__, __LINE__);
 
                        // Get all affected (deleted) rows
-                       $deletedStats += SQL_AFFECTEDROWS();
+                       $deletedStats += sqlAffectedRows();
 
                        // Reset query (to prevent possible errors) ...
-                       $result_mails = SQL_QUERY("SELECT
+                       $result_mails = sqlQuery("SELECT
        `userid` AS `sender`
 FROM
        `{?_MYSQL_PREFIX?}_user_stats`
@@ -116,7 +116,7 @@ ORDER BY
 } // END - if
 
 // Free memory
-SQL_FREERESULT($result_mails);
+sqlFreeResult($result_mails);
 
 // Is there deleted mails and the admin want's to receive a notification
 if (($deletedStats > 0) && (getConfig('ap_dm_notify') == 'Y')) {