]> git.mxchange.org Git - mailer.git/blobdiff - inc/db/lib-mysql3.php
Several fixes for module/action/what handling.
[mailer.git] / inc / db / lib-mysql3.php
index c00b59971df0351ae72505547d74940f997aa217..8ed21c3218340cb79142db44896e4dbb535793b6 100644 (file)
@@ -75,7 +75,7 @@ function SQL_QUERY ($sqlString, $F, $L) {
        $sqlString = FILTER_COMPILE_CONFIG($sqlString, true);
 
        // Starting time
-       $querytimeBefore = array_sum(explode(' ', microtime()));
+       $querytimeBefore = microtime(true);
 
        // Run SQL command
        //* DEBUG: */ print('F=' . basename($F) . ',L=' . $L . 'sql=' . $sqlString . '<br />');
@@ -85,11 +85,8 @@ Query string:<br />
 ' . $sqlString);
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sql=' . $sqlString . ',numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS());
 
-       // Ending time
-       $querytimeAfter = array_sum(explode(' ', microtime()));
-
        // Calculate query time
-       $queryTime = $querytimeAfter - $querytimeBefore;
+       $queryTime = microtime(true) - $querytimeBefore;
 
        // Add this query to array including timing
        addSqlToDebug($result, $sqlString, $queryTime, $F, $L);
@@ -108,7 +105,7 @@ Query string:<br />
                //
                // Debugging stuff...
                //
-               $fp = fopen(getConfig('CACHE_PATH') . 'mysql.log', 'a') or app_die(__FILE__, __LINE__, "Cannot write mysql.log!");
+               $fp = fopen(getConfig('CACHE_PATH') . 'mysql.log', 'a') or app_die(__FILE__, __LINE__, 'Cannot write mysql.log!');
                if (!isset($GLOBALS['sql_first_entry'])) {
                        // Write first entry
                        fwrite($fp, 'Module=' . getModule() . "\n");