X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffix_refsystem.php;h=a932a5c4baeff6b873eb5243f2ab348498424c3a;hp=a63edb3019fee6ec231772691ead1f2fcb91b9a6;hb=a00ad7dd8c36a5322e28f38d8d641efb90c00c92;hpb=cd7d344ea7007cfa20413acd3e03e50f0ab86d86 diff --git a/inc/fix_refsystem.php b/inc/fix_refsystem.php index a63edb3019..a932a5c4ba 100644 --- a/inc/fix_refsystem.php +++ b/inc/fix_refsystem.php @@ -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] ?>