]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-manager.php
Some minor improvements
[mailer.git] / inc / mysql-manager.php
index e5fe404f48a6f692d9ffe14e7057869974d01459..5ddcf36369720afeffb55901dd9f5470a112a02e 100644 (file)
@@ -990,14 +990,13 @@ function removeReceiver (&$receivers, $key, $userid, $poolId, $statsId = 0, $isB
 
 // Calculate sum (default) or count records of given criteria
 function countSumTotalData ($search, $tableName, $lookFor = 'id', $whereStatement = 'userid', $countRows = FALSE, $add = '', $mode = '=') {
-       // Init count/sum
-       $data['res'] = '0';
-
+       // Debug message
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',tableName=' . $tableName . ',lookFor=' . $lookFor . ',whereStatement=' . $whereStatement . ',add=' . $add);
        if ((empty($search)) && ($search != '0')) {
                // Count or sum whole table?
                if ($countRows === TRUE) {
                        // Count whole table
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'COUNT!');
                        $result = SQL_QUERY_ESC('SELECT COUNT(`%s`) AS `res` FROM `{?_MYSQL_PREFIX?}_%s`' . $add . ' LIMIT 1',
                                array(
                                        $lookFor,
@@ -1005,6 +1004,7 @@ function countSumTotalData ($search, $tableName, $lookFor = 'id', $whereStatemen
                                ), __FUNCTION__, __LINE__);
                } else {
                        // Sum whole table
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SUM!');
                        $result = SQL_QUERY_ESC('SELECT SUM(`%s`) AS `res` FROM `{?_MYSQL_PREFIX?}_%s`' . $add . ' LIMIT 1',
                                array(
                                        $lookFor,