]> git.mxchange.org Git - mailer.git/blobdiff - inc/db/lib-mysql3.php
A little more easier text
[mailer.git] / inc / db / lib-mysql3.php
index aada78066645053339dc73754f1b19191a7cbb5e..d2d13ba4530eb4dc92544699149b3ee06ead3ead 100644 (file)
@@ -14,8 +14,6 @@
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
@@ -101,7 +99,7 @@ function SQL_QUERY ($sqlString, $F, $L, $enableCodes = true) {
        incrementConfigEntry('sql_count');
 
        // Debug output
-       if ((getScriptOutputMode() != 1) && (isDebugModeEnabled()) && (isSqlDebuggingEnabled())) {
+       if ((!isCssOutputMode()) && (isDebugModeEnabled()) && (isSqlDebuggingEnabled())) {
                //
                // Debugging stuff...
                //
@@ -137,9 +135,15 @@ function SQL_NUMROWS ($resource) {
        $lines = false;
 
        // Is the result a valid resource?
-       if (is_resource($resource)) {
+       if (isset($GLOBALS['sql_numrows'][$resource])) {
+               // Use cache
+               $lines = $GLOBALS['sql_numrows'][intval($resource)];
+       } elseif (is_resource($resource)) {
                // Get the count of rows from database
                $lines = mysql_num_rows($resource);
+
+               // Remember it in cache
+               $GLOBALS['sql_numrows'][intval($resource)] = $lines;
        } else {
                // No resource given, please fix this
                debug_report_bug(__FUNCTION__, __LINE__, 'No resource given! result[]=' . gettype($resource) . ',last_sql=' .  $GLOBALS['last_sql']);
@@ -171,7 +175,7 @@ function SQL_FETCHROW ($resource) {
 }
 
 // SQL fetch array
-function SQL_FETCHARRAY ($res, $nr=0) {
+function SQL_FETCHARRAY ($res) {
        // Is a result resource set?
        if ((!is_resource($res)) || (!SQL_IS_LINK_UP())) return false;