]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-repair_cats.php
Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / modules / admin / what-repair_cats.php
index a3fd099fa282930bad8028e113ef1bf3dfbee1f2..e72df0959f09c3b342d8ad7de36eab5003705039 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -44,19 +44,20 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 addYouAreHereLink('admin', __FILE__);
 
 // Go through all categories
-$result = SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_cats` GROUP BY `userid` ORDER BY `userid` ASC", __FILE__, __LINE__);
-if (!SQL_HASZERONUMS($result)) {
+$result = sqlQuery("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_cats` GROUP BY `userid` ORDER BY `userid` ASC", __FILE__, __LINE__);
+
+if (!ifSqlHasZeroNumRows($result)) {
         // Nothing is removed for now... ;-)
        $removedRows = '0';
 
        // Check if found userid is also found in user_data table
-       while ($content = SQL_FETCHARRAY($result)) {
+       while ($content = sqlFetchArray($result)) {
                // Is the account not there?
                if (!fetchUserData($content['userid'])) {
                        // Ok, we found something to remove
-                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `userid`=%s",
+                       sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `userid`=%s",
                                array(bigintval($content['userid'])), __FILE__, __LINE__);
-                       $removedRows += SQL_AFFECTEDROWS();
+                       $removedRows += sqlAffectedRows();
                } // END - if
        } // END - while