Global variables rewritten
[mailer.git] / inc / db / lib-mysql3.php
index 50b7189f8358b768cbee03da7fc8115b129c3c5e..ea128166a729c5e3632e70da4df57ee9be7915d2 100644 (file)
@@ -39,7 +39,7 @@ if (!defined('__SECURITY')) {
 
 // SQL queries
 function SQL_QUERY ($sql_string, $F, $L) {
-       global $link, $CSS, $OK;
+       global $link, $OK;
 
        // Link is up?
        if (!is_resource($link)) return false;
@@ -75,7 +75,7 @@ Query string:<br />
        // Debug output
        //* DEBUG: */ print "Query=<pre>".$sql_string."</pre>, affected=<strong>".SQL_AFFECTEDROWS()."</strong>, numrows=<strong>".SQL_NUMROWS($result)."</strong><br />\n";
 
-       if (($CSS != "1") && ($CSS != "-1") && (isBooleanConstantAndTrue('DEBUG_MODE')) && (isBooleanConstantAndTrue('DEBUG_SQL'))) {
+       if (($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1") && (isBooleanConstantAndTrue('DEBUG_MODE')) && (isBooleanConstantAndTrue('DEBUG_SQL'))) {
                //
                // Debugging stuff...
                //
@@ -197,8 +197,6 @@ function SQL_SELECT_DB ($dbName, $link, $F, $L) {
 
 // SQL close link
 function SQL_CLOSE (&$link, $F, $L) {
-       global $cacheInstance, $cacheArray;
-
        if (!is_resource($link)) {
                // Skip double close
                return false;
@@ -206,7 +204,7 @@ function SQL_CLOSE (&$link, $F, $L) {
 
        // Do we need to update cache/db counter?
        //* DEBUG: */ echo "DB=".getConfig('db_hits').",CACHE=".getConfig('cache_hits')."<br />\n";
-       if ((GET_EXT_VERSION("cache") >= "0.0.7") && (getConfig('db_hits') > 0) && (getConfig('cache_hits') > 0) && (is_object($cacheInstance))) {
+       if ((GET_EXT_VERSION("cache") >= "0.0.7") && (getConfig('db_hits') > 0) && (getConfig('cache_hits') > 0) && (is_object($GLOBALS['cache_instance']))) {
                // Add new hits
                incrementConfigEntry('db_hits', getConfig('db_hits_run'));