X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fdb%2Flib-mysql3.php;h=513137e8b437c9ec6c92964b5147eb6fbabf386b;hp=c0af2231674b1de36ea5a237807fb760a5ff26d9;hb=8383fc52cd2340ea1756f9e1808fa3589e27c341;hpb=52e8a0635bd0b7c653845685c55e4e5f251375fe
diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php
index c0af223167..513137e8b4 100644
--- a/inc/db/lib-mysql3.php
+++ b/inc/db/lib-mysql3.php
@@ -43,6 +43,9 @@ function SQL_QUERY($sql_string, $F, $L)
{
global $link, $CSS, $_CONFIG, $OK;
+ // Remove \t, \n and \r from queries they may confuse some MySQL version I have heard
+ $sql_string = str_replace("\t", " ", str_replace("\n", " ", str_replace("\r", " ", $sql_string)));
+
// Run SQL command
$result = @mysql_query($sql_string, $link)
or ADD_FATAL($F." (".$L."):".mysql_error()."
@@ -54,9 +57,9 @@ function SQL_QUERY($sql_string, $F, $L)
$_CONFIG['sql_count']++;
// Debug output
- //* DEBUG: */ print "Query=".$sql_string.", affected=".SQL_AFFECTEDROWS().", numrows=".SQL_NUMROWS($result)."
\n";
+ //* DEBUG: */ print "Query=
".$sql_string."
, affected=".SQL_AFFECTEDROWS().", numrows=".SQL_NUMROWS($result)."
\n";
- if (($CSS != "1") && ($CSS != "-1") && (DEBUG_MODE) && (DEBUG_SQL))
+ if (($CSS != "1") && ($CSS != "-1") && (isBooleanConstantAndTrue('DEBUG_MODE')) && (DEBUG_SQL))
{
//
// Debugging stuff...
@@ -67,7 +70,7 @@ function SQL_QUERY($sql_string, $F, $L)
fwrite($fp, "Module=".$GLOBALS['module']."\n");
$OK = true;
}
- fwrite($fp, $F."(LINE=".$L."|NUM=".SQL_NUMROWS($result)."|AFFECTED=".SQL_AFFECTEDROWS()."): ".str_replace('\r', '', str_replace('\n', " ", $sql_string))."\n");
+ fwrite($fp, $F."(LINE=".$L."|NUM=".SQL_NUMROWS($result)."|AFFECTED=".SQL_AFFECTEDROWS()."): ".str_replace('\r', "", str_replace('\n', " ", $sql_string))."\n");
fclose($fp);
}
@@ -137,7 +140,7 @@ function SQL_FETCHARRAY($res=false, $nr=0, $remove_numerical=true)
// Shall we remove numerical data here automatically?
if ($remove_numerical)
{
- // So let's remove all numerical elements to save memory!
+ // So let's remove all numerical elements to save memory!
$max = count($row);
for ($idx = 0; $idx < ($max / 2); $idx++)
{
@@ -234,7 +237,7 @@ function SQL_QUERY_ESC($qstring, $data, $file, $line, $run=true, $strip=true)
// Debugging
//
//$fp = fopen(PATH."escape_debug.log", 'a') or mxchange_die("Cannot write debug.log!");
- //fwrite($fp, $file."(".$line."): ".str_replace('\r', '', str_replace('\n', " ", $eval))."\n");
+ //fwrite($fp, $file."(".$line."): ".str_replace('\r', "", str_replace('\n', " ", $eval))."\n");
//fclose($fp);
eval($eval);
if ($run)