]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-manager.php
Commented out debug lines again
[mailer.git] / inc / mysql-manager.php
index e5fe404f48a6f692d9ffe14e7057869974d01459..bbd60234bdfc3dde0ad943b62b4e526358fff69b 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,
@@ -1918,7 +1918,7 @@ function doGenericListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId,
                foreach ($orderByColumns as $orderByColumn => $array) {
                        // Get keys (table/alias) and values (sorting itself)
                        $table   = trim(implode('', array_keys($array)));
-                       $sorting = trim(implode('', array_keys($array)));
+                       $sorting = trim(implode('', array_values($array)));
 
                        // table/alias can be omitted
                        if (!empty($table)) {