More globals rewritten, see #100
[mailer.git] / inc / db / lib-mysql3.php
index 4492111863fba94c9f3d3f29edc9763e75de89ff..c98de977be81d2937759380e69ac50f6403a82c9 100644 (file)
@@ -39,8 +39,6 @@ if (!defined('__SECURITY')) {
 
 // SQL queries
 function SQL_QUERY ($sql_string, $F, $L) {
-       global $OK;
-
        // Link is up?
        if (!SQL_IS_LINK_UP()) return false;
 
@@ -80,10 +78,10 @@ Query string:<br />
                // Debugging stuff...
                //
                $fp = fopen(constant('PATH')."inc/cache/mysql.log", 'a') or mxchange_die("Cannot write mysql.log!");
-               if (!isset($OK)) {
+               if (!isset($GLOBALS['sql_first_entry'])) {
                        // Write first entry
                        fwrite($fp, "Module=".$GLOBALS['module']."\n");
-                       $OK = true;
+                       $GLOBALS['sql_first_entry'] = true;
                } // END - if
                fwrite($fp, $F."(LINE=".$L."|NUM=".SQL_NUMROWS($result)."|AFFECTED=".SQL_AFFECTEDROWS()."|QUERYTIME:".$queryTime."): ".str_replace('\r', "", str_replace('\n', " ", $sql_string))."\n");
                fclose($fp);