X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fdb%2Flib-mysql3.php;h=14a4b6f9cc8cc5078b1a625c018ffa1f84806066;hp=8c20de47cf773f49493b16cb10013935ec27f249;hb=b4021b2ca326afc81c36b420ecfd247a00067bd1;hpb=735545e765720a954a345bc068239e2fffa0dbe1 diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index 8c20de47cf..14a4b6f9cc 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -1,7 +1,7 @@ '); + //* DEBUG: */ print('F=' . basename($F) . ',L=' . $L . 'sql=' . htmlentities($sqlString) . '
'); $result = mysql_query($sqlString, SQL_GET_LINK()) or addFatalMessage(__FUNCTION__, __LINE__, $F . ' (' . $L . '):' . mysql_error() . '
Query string:
' . $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 +108,7 @@ Query string:
// // 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"); @@ -313,8 +313,8 @@ function SQL_ESCAPE ($str, $secureString=true, $strip=true) { } // END - if if (!SQL_IS_LINK_UP()) { - // Fall-back to addslashes() when there is no link - $ret = addslashes($str); + // Fall-back to escapeQuotes() when there is no link + $ret = escapeQuotes($str); } elseif (function_exists('mysql_real_escape_string')) { // The new and improved version //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'str='.$str); @@ -323,8 +323,8 @@ function SQL_ESCAPE ($str, $secureString=true, $strip=true) { // The obsolete function $ret = mysql_escape_string($str, SQL_GET_LINK()); } else { - // If nothing else works, fall back to addslashes() again - $ret = addslashes($str); + // If nothing else works, fall back to escapeQuotes() again + $ret = escapeQuotes($str); } // Cache result