]> git.mxchange.org Git - mailer.git/blobdiff - inc/purge/purge-coupon.php
Typo fixed.
[mailer.git] / inc / purge / purge-coupon.php
index 8502b3dd10617d8d86a64b765ae427ec152d2f5f..3af67078a73b3087cd923e7eb4b07122c9319757 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
 if (!defined('__SECURITY')) {
        die();
 } elseif (!isExtensionActive('coupon')) {
-       logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension disabled.');
+       logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-coupon disabled.');
        return;
 }
 
 // Search for all expired coupons that we can purge
-$result = SQL_QUERY('SELECT
+$result = sqlQuery('SELECT
        `id`,
        UNIX_TIMESTAMP(`coupon_created`) AS `coupon_created`,
        UNIX_TIMESTAMP(`coupon_expired`) AS `coupon_expired`,
@@ -59,14 +59,14 @@ WHERE
 ORDER BY
        `id` ASC', __FILE__, __LINE__);
 
-// Do we have entries?
-if (SQL_NUMROWS($result) > 0) {
+// Are there entries?
+if (sqlNumRows($result) > 0) {
        // Init variables
        $out = '';
        $ids = array();
 
        // Start purging all
-       while ($content = SQL_FETCHARRAY($result)) {
+       while ($content = sqlFetchArray($result)) {
                // Add id
                array_push($ids, $content['id']);
 
@@ -79,10 +79,10 @@ if (SQL_NUMROWS($result) > 0) {
        } // END - while
 
        // Purge all entries
-       SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_coupon_data` WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`coupon_expired`)) >= {?coupon_autopurge_time?}', __FILE__, __LINE__);
+       sqlQuery('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_coupon_data` WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`coupon_expired`)) >= {?coupon_autopurge_time?}', __FILE__, __LINE__);
 
        // Purge also user entries
-       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_coupons` WHERE `coupon_id` IN (%s) LIMIT %s",
+       sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_coupons` WHERE `coupon_id` IN (%s) LIMIT %s",
                array(
                        implode(',', $ids),
                        count($ids)
@@ -93,7 +93,7 @@ if (SQL_NUMROWS($result) > 0) {
 } // END - if
 
 // Free result
-SQL_FREERESULT($result);
+sqlFreeResult($result);
 
 // [EOF]
 ?>