Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / modules / member / what-categories.php
index c884fbaafe8b093370cd24ce5019fc98cec673f7..d1ddf06e1feeea0cb8cfed22275d33a37f0765c7 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 *
@@ -49,10 +49,17 @@ $whereStatement = " WHERE `visible`='Y'";
 if (isAdmin()) $whereStatement = '';
 
 // Get all categories
-$result = SQL_QUERY('SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats`' . $whereStatement . ' ORDER BY `sort` ASC', __FILE__, __LINE__);
+$result = sqlQuery('SELECT
+       `id`,
+       `cat`
+FROM
+       `{?_MYSQL_PREFIX?}_cats`
+' . $whereStatement . '
+ORDER BY
+       `sort` ASC', __FILE__, __LINE__);
 
 // Are there entries?
-if (!SQL_HASZERONUMS($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        $LEAST = FALSE;
        if (isFormSent()) {
                $count = '0';
@@ -60,7 +67,7 @@ if (!SQL_HASZERONUMS($result)) {
                        if ($joined != 'Y') $count++;
                } // END - foreach
 
-               if ((SQL_NUMROWS($result) - $count) < getLeastCats()) {
+               if ((sqlNumRows($result) - $count) < getLeastCats()) {
                        unsetPostRequestElement('ok');
                        $LEAST = TRUE;
                } // END - if
@@ -114,7 +121,7 @@ if (!SQL_HASZERONUMS($result)) {
 
                // Load all categories of this member
                $OUT = '';
-               while ($content = SQL_FETCHARRAY($result)) {
+               while ($content = sqlFetchArray($result)) {
                        // Default he has not joined, add color switch
                        $content['jn'] = ' checked="checked"';
                        $content['jy'] = '';
@@ -139,7 +146,7 @@ if (!SQL_HASZERONUMS($result)) {
                } // END - while
 
                // Free result
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
 
                // Load footer template
                loadTemplate('member_cats', FALSE, $OUT);
@@ -150,7 +157,7 @@ if (!SQL_HASZERONUMS($result)) {
 }
 
 // Free result
-SQL_FREERESULT($result);
+sqlFreeResult($result);
 
 // [EOF]
 ?>