X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fdb%2Flib-mysql3.php;h=0c2b15b17f24bf7e8715cdf2449928196ea0820a;hb=58b29a924c48e7c1ce38c435c92e541b53984c56;hp=8dec70f75c3dec4c4917ce1a64870438b783cc57;hpb=14958a98e5119a7088b84e80e05908efa9bea760;p=mailer.git
diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php
index 8dec70f75c..0c2b15b17f 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,7 +57,7 @@ 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))
{
@@ -180,21 +183,21 @@ function SQL_SELECT_DB($DB, $link, $F, $L)
// SQL close link
function SQL_CLOSE($link, $F, $L)
{
- global $_CONFIG, $CACHE, $CFG_CACHE;
- if ((GET_EXT_VERSION("cache") >= "0.0.7") && (isset($_CONFIG['db_hits'])) && (isset($_CONFIG['cache_hits'])) && (is_object($CACHE)))
+ global $_CONFIG, $cacheInstance, $cacheArray;
+ if ((GET_EXT_VERSION("cache") >= "0.0.7") && (isset($_CONFIG['db_hits'])) && (isset($_CONFIG['cache_hits'])) && (is_object($cacheInstance)))
{
// Update counter for db/cache
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET db_hits=%d, cache_hits=%d WHERE config='0' LIMIT 1",
+ $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET db_hits=%d, cache_hits=%d WHERE config=0 LIMIT 1",
array(bigintval($_CONFIG['db_hits']), bigintval($_CONFIG['cache_hits'])), __FILE__, __LINE__);
// Update cache here
if (GET_EXT_VERSION("cache") >= "0.1.2")
{
- if ($CACHE->cache_file("config", true))
+ if ($cacheInstance->cache_file("config", true))
{
// Replace data
- $CACHE->cache_replace("cache_hits", $_CONFIG['cache_hits'], "0", $CFG_CACHE);
- $CACHE->cache_replace("db_hits" , $_CONFIG['db_hits'] , "0", $CFG_CACHE);
+ $cacheInstance->cache_replace("cache_hits", $_CONFIG['cache_hits'], "0", $cacheArray);
+ $cacheInstance->cache_replace("db_hits" , $_CONFIG['db_hits'] , "0", $cacheArray);
}
}
}