X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fdb%2Flib-mysql3.php;h=a5b6d67c78624631f7993732ad1a4034d68f4137;hp=e709c8a0d95d03dcc8c3a4584c58be7297c97a60;hb=26ea563a90454a2cde58f8cd134542a0d8f14780;hpb=013448f0470ca36ab15b888928e2127e6da7d9b6 diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index e709c8a0d9..a5b6d67c78 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -83,7 +83,7 @@ function SQL_QUERY ($sqlString, $F, $L) { or addFatalMessage(__FUNCTION__, __LINE__, $F . ' (' . $L . '):' . mysql_error() . '
Query string:
' . $sqlString); - //* DEBUG: */ outputHtml(__LINE__ . ': numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS() . "
"); + //* DEBUG: */ print(__LINE__ . ': numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS() . "
"); // Ending time $querytimeAfter = array_sum(explode(' ', microtime())); @@ -104,7 +104,7 @@ Query string:
incrementConfigEntry('sql_count'); // Debug output - if ((getOutputMode() != '1') && (isDebugModeEnabled()) && (getConfig('DEBUG_SQL') == 'Y')) { + if ((getOutputMode() != 1) && (isDebugModeEnabled()) && (isConfigEntrySet('DEBUG_SQL')) && (getConfig('DEBUG_SQL') == 'Y')) { // // Debugging stuff... // @@ -119,12 +119,12 @@ Query string:
} // END - if // Count DB hits - if (!isStatsEntrySet('db_hits_run')) { + if (!isStatsEntrySet('db_hits')) { // Count in dummy variable - setStatsEntry('db_hits_run', 1); + setStatsEntry('db_hits', 1); } else { // Count to config array - incrementStatsEntry('db_hits_run'); + incrementStatsEntry('db_hits'); } // Return the result @@ -252,9 +252,6 @@ function SQL_CLOSE ($F, $L) { // Destroy cache unset($GLOBALS['sql_link_res']); - // Move stats - incrementStatsEntry('db_hits', getStatsEntry('db_hits_run')); - // Return the result return $close; } @@ -363,7 +360,7 @@ function SQL_ESCAPE ($str, $secureString=true, $strip=true) { $ret = smartAddSlashes($str); } elseif (function_exists('mysql_real_escape_string')) { // The new and improved version - //* DEBUG: */ outputHtml(__FUNCTION__."(".__LINE__."):str={$str}
"); + //* DEBUG: */ print(__FUNCTION__."(".__LINE__."):str={$str}
"); $ret = mysql_real_escape_string($str, SQL_GET_LINK()); } elseif (function_exists('mysql_escape_string')) { // The obsolete function @@ -444,7 +441,7 @@ function SQL_ALTER_TABLE ($sql, $F, $L) { // 123 4 4 3 3 4 4 32 23 4 4 3 3 4 4 321 if (((SQL_NUMROWS($result) == 0) && (strpos($sql, 'ADD') !== false)) || ((SQL_NUMROWS($result) == 1) && (strpos($sql, 'DROP') !== false))) { // Do the query - //* DEBUG: */ outputHtml(__LINE__.':'.$sql."
"); + //* DEBUG: */ print(__LINE__.':'.$sql."
"); $result = SQL_QUERY($sql, $F, $L, false); } // END - if } elseif ((getConfig('_TABLE_TYPE') == 'InnoDB') && (strpos($sql, 'FULLTEXT') !== false)) { @@ -461,11 +458,11 @@ function SQL_ALTER_TABLE ($sql, $F, $L) { while (strpos($columnName, ',') !== false) { // Use last $columnName = str_replace('`', '', $tableArray[count($tableArray) - $begin]); - //* DEBUG: */ outputHtml(__LINE__.':'.$columnName."----------------".$begin."
"); + //* DEBUG: */ print(__LINE__.':'.$columnName."----------------".$begin."
"); // Remove brackes $columnName = str_replace('(', '', str_replace(')', '', $columnName)); - //* DEBUG: */ outputHtml(__LINE__.':'.$columnName."----------------".$begin."
"); + //* DEBUG: */ print(__LINE__.':'.$columnName."----------------".$begin."
"); // Continue $begin++; @@ -480,7 +477,7 @@ function SQL_ALTER_TABLE ($sql, $F, $L) { $skip = false; while ($content = SQL_FETCHARRAY($result)) { // Is it found? - //* DEBUG: */ outputHtml("
".print_r($content, true)."
"); + //* DEBUG: */ print("
".print_r($content, true)."
"); if (($content['Column_name'] == $columnName) || ($content['Key_name'] == $columnName)) { // Skip this query! //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Skiped: %s", $sql)); @@ -495,12 +492,12 @@ function SQL_ALTER_TABLE ($sql, $F, $L) { // Shall we run it? if ($skip === false) { // Send it to the SQL_QUERY() function - //* DEBUG: */ outputHtml(__LINE__.':'.$sql."
"); + //* DEBUG: */ print(__LINE__.':'.$sql."
"); $result = SQL_QUERY($sql, $F, $L, false); } // END - if } else { // Other ALTER TABLE query - //* DEBUG: */ outputHtml(__LINE__.':'.$sql."
"); + //* DEBUG: */ print(__LINE__.':'.$sql."
"); $result = SQL_QUERY($sql, $F, $L, false); }