X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffix_user_points.php;h=b4a61ae4f9618e7840689adaa45a692ca6f0ea62;hp=4d637f31f76c80e6d80a42a8b33790367f5bfa55;hb=155492a5b96cec674846973a8524238b0365a848;hpb=da5c63bacddced77a951cbe7b223f314885a6c87 diff --git a/inc/fix_user_points.php b/inc/fix_user_points.php index 4d637f31f7..b4a61ae4f9 100644 --- a/inc/fix_user_points.php +++ b/inc/fix_user_points.php @@ -41,7 +41,7 @@ if (!defined('__SECURITY')) { } // END - if // Get all user points -$result = SQL_QUERY('SELECT +$result = sqlQuery('SELECT `userid`, `points`, `locked_points`, @@ -55,15 +55,15 @@ ORDER BY `userid` ASC', __FILE__, __LINE__); // Are there entries? (there should be!) -if (!SQL_HASZERONUMS($result)) { +if (!ifSqlHasZeroNums($result)) { // Load row by row - while ($row = SQL_FETCHARRAY($result)) { + while ($row = sqlFetchArray($result)) { // Update the database again foreach (array_keys($row) as $column) { // Not userid itself if ($column != 'userid') { // Update amount - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `%s`=`%s`+%s WHERE `userid`=%s AND `ref_depth` IS NULL", + sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `%s`=`%s`+%s WHERE `userid`=%s AND `ref_depth` IS NULL", array( $column, $column, @@ -72,9 +72,9 @@ if (!SQL_HASZERONUMS($result)) { ), __FILE__, __LINE__); // Nothing has been updated? - if (SQL_HASZEROAFFECTED()) { + if (ifSqlHasZeroAffectedRows()) { // Then insert it - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_points` (`userid`, `ref_depth`, `%s`) VALUES (%s,NULL,%s)", + sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_user_points` (`userid`, `ref_depth`, `%s`) VALUES (%s,NULL,%s)", array( $column, $row['userid'], @@ -87,10 +87,10 @@ if (!SQL_HASZERONUMS($result)) { } // END - if // Free result -SQL_FREERESULT($result); +sqlFreeResult($result); // Remove all entries -SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `ref_depth`=0', __FILE__, __LINE__); +sqlQuery('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `ref_depth`=0', __FILE__, __LINE__); // [EOF] ?>