Renamed all SQL-related functions to camel-case notation
[mailer.git] / inc / purge / purge-coupon.php
index a0cf1f3fb851cc439264d1caf8d1082855e5eda9..3af67078a73b3087cd923e7eb4b07122c9319757 100644 (file)
@@ -44,7 +44,7 @@ if (!defined('__SECURITY')) {
 }
 
 // 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`,
@@ -60,13 +60,13 @@ ORDER BY
        `id` ASC', __FILE__, __LINE__);
 
 // Are there entries?
-if (SQL_NUMROWS($result) > 0) {
+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]
 ?>