]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-manager.php
Continued a bit:
[mailer.git] / inc / mysql-manager.php
index 314642ed0c89fecd759ec12e6abcc445160892c1..d41930089f6bdf7d40a73bd10073d351fbbc64bf 100644 (file)
@@ -11,7 +11,7 @@
  * Kurzbeschreibung  : Alle datenbank-relevanten Funktionen             *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -222,7 +222,7 @@ ORDER BY
                array($mode), __FUNCTION__, __LINE__);
 
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',getWhat()=' . getWhat());
-       if (!ifSqlHasZeroNums($result_main)) {
+       if (!ifSqlHasZeroNumRows($result_main)) {
                // There are menus available, so we simply display them... :)
                $GLOBALS['rows'] = '';
                while ($content = sqlFetchArray($result_main)) {
@@ -254,7 +254,7 @@ ORDER BY
                                ), __FUNCTION__, __LINE__);
 
                        // Are there some entries?
-                       if (!ifSqlHasZeroNums($result_sub)) {
+                       if (!ifSqlHasZeroNumRows($result_sub)) {
                                // Init counter
                                $count = '0';
 
@@ -665,7 +665,7 @@ function addMaxReceiveList ($mode, $default = '') {
        }
 
        // Some entries are found?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                $OUT = '';
                while ($content = sqlFetchArray($result)) {
                        $OUT .= '      <option value="' . $content['value'] . '"';
@@ -784,7 +784,7 @@ function isMenuActionValid ($mode, $action, $what, $updateEntry = FALSE) {
                $ret = (!ifSqlHasZeroAffectedRows());
        } else {
                // Check found rows
-               $ret = (!ifSqlHasZeroNums($result));
+               $ret = (!ifSqlHasZeroNumRows($result));
        }
 
        // Free memory
@@ -874,20 +874,21 @@ function getCategory ($cid) {
        // Is the category id set?
        if (!isValidId($cid)) {
                // No category
-               $data['cat'] = '{--_CATEGORY_NONE--}';
-       } elseif (isValidId($cid)) {
-               // Lookup the category in database
-               $result = sqlQueryEscaped('SELECT `cat` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1',
-                       array(bigintval($cid)), __FUNCTION__, __LINE__);
-               if (sqlNumRows($result) == 1) {
-                       // Category found... :-)
-                       $data = sqlFetchArray($result);
-               } // END - if
+               return '{--_CATEGORY_NONE--}';
+       } // END - if
 
-               // Free result
-               sqlFreeResult($result);
+       // Lookup the category in database
+       $result = sqlQueryEscaped('SELECT `cat` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1',
+               array(bigintval($cid)), __FUNCTION__, __LINE__);
+
+       if (sqlNumRows($result) == 1) {
+               // Category found... :-)
+               $data = sqlFetchArray($result);
        } // END - if
 
+       // Free result
+       sqlFreeResult($result);
+
        // Return result
        return $data['cat'];
 }
@@ -989,7 +990,7 @@ function removeReceiver (&$receivers, $key, $userid, $poolId, $statsId = 0, $isB
                                ), __FUNCTION__, __LINE__);
 
                        // Was it *not* found?
-                       if (ifSqlHasZeroNums($result)) {
+                       if (ifSqlHasZeroNumRows($result)) {
                                // So we add one!
                                sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_user_links` (`%s`, `userid`, `link_type`) VALUES (%s,%s,'%s')",
                                        array(
@@ -1446,7 +1447,7 @@ function generateOptions ($table, $key, $value, $default = '', $extra = '', $whe
                        ), __FUNCTION__, __LINE__);
 
                // Is there rows?
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // Found data so add them as OPTION lines
                        while ($content = sqlFetchArray($result)) {
                                // Is extra set?
@@ -1617,7 +1618,7 @@ ORDER BY
                __FUNCTION__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // ... and begin loading stuff
                while ($content = sqlFetchArray($result)) {
                        // Transfer some data
@@ -1849,7 +1850,7 @@ function reduceRecipientReceivedMails ($column, $id, $count) {
        );
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Now load all userids for one big query!
                $userids = array();
                while ($data = sqlFetchArray($result)) {
@@ -2008,7 +2009,7 @@ function doListEntries ($sql, $tableTemplate, $noEntryMessageId, $rowTemplate, $
        $result = sqlQuery($sql, __FUNCTION__, __LINE__);
 
        // Are there some URLs left?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List all URLs
                $OUT = '';
                while ($row = sqlFetchArray($result)) {
@@ -2538,7 +2539,7 @@ ORDER BY
        $rows = array();
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Load all entries
                while ($row = sqlFetchArray($result)) {
                        array_push($rows, $row);