X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffix_refsystem.php;h=a932a5c4baeff6b873eb5243f2ab348498424c3a;hb=5eb7669649ebf60e74a83df70ad4f357d656b204;hp=bf874dbc2f9082496569fb22222143f91c1e5e0d;hpb=8fad776382e63b3f73f8dbe289f229d79cfc2c22;p=mailer.git diff --git a/inc/fix_refsystem.php b/inc/fix_refsystem.php index bf874dbc2f..a932a5c4ba 100644 --- a/inc/fix_refsystem.php +++ b/inc/fix_refsystem.php @@ -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 * @@ -41,29 +41,29 @@ if (!defined('__SECURITY')) { } // END - if // Sanity-check: Is there ref level 0? If so, this must be fixed to NULL and `level` must be increased by one -$result = SQL_QUERY('SELECT `id` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `level`=0', __FILE__, __LINE__); -if (!SQL_HASZERONUMS($result)) { +$result = sqlQuery('SELECT `id` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `level`=0', __FILE__, __LINE__); +if (!ifSqlHasZeroNums($result)) { // Remove index temporaly - SQL_ALTER_TABLE('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `userid_level`', __FILE__, __LINE__); + sqlQueryAlterTable('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `userid_level`', __FILE__, __LINE__); // Upgrade refsystem - SQL_QUERY('UPDATE `{?_MYSQL_PREFIX?}_refsystem` SET `level`=`level`+1', __FILE__, __LINE__); + sqlQuery('UPDATE `{?_MYSQL_PREFIX?}_refsystem` SET `level`=`level`+1', __FILE__, __LINE__); // Add it again - SQL_ALTER_TABLE('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD UNIQUE INDEX `userid_level` (`userid`,`level`)', __FILE__, __LINE__); + sqlQueryAlterTable('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` ADD UNIQUE INDEX `userid_level` (`userid`, `level`)', __FILE__, __LINE__); // Rebuild cache rebuildCache('refsystem', 'refsystem'); } // END - if // Free result -SQL_FREERESULT($result); +sqlFreeResult($result); // Reset the table -SQL_QUERY('TRUNCATE TABLE `{?_MYSQL_PREFIX?}_user_refs`', __FILE__, __LINE__); +sqlQuery('TRUNCATE TABLE `{?_MYSQL_PREFIX?}_user_refs`', __FILE__, __LINE__); // Begin with all users in level one -$result_direct = SQL_QUERY('SELECT +$result_direct = sqlQuery('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` @@ -74,9 +74,9 @@ ORDER BY `userid` ASC', __FILE__, __LINE__); // Are there entries? -if (!SQL_HASZERONUMS($result_direct)) { +if (!ifSqlHasZeroNums($result_direct)) { // When 'walk' through all users - while ($content = SQL_FETCHARRAY($result_direct)) { + while ($content = sqlFetchArray($result_direct)) { // Update refback table /* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'userid=' . $content['userid'] . ' - BEFORE!'); updateReferralTable($content['userid']); @@ -85,7 +85,7 @@ if (!SQL_HASZERONUMS($result_direct)) { } // END - if // Free result -SQL_FREERESULT($result_direct); +sqlFreeResult($result_direct); // [EOF] ?>