* svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
// Remove \t, \n and \r from queries they may confuse some MySQL version I have heard
$sqlString = str_replace("\t", ' ', str_replace("\n", ' ', str_replace("\r", ' ', $sqlString)));
- // Compile config out
- $sqlString = FILTER_COMPILE_CONFIG($sqlString, true);
+ // Replace {PER}
+ $sqlString = str_replace('{PER}', '%', $sqlString);
+
+ // Compile config entries out
+ $eval = "\$sqlString = \"".FILTER_COMPILE_CONFIG(escapeQuotes($sqlString))."\";";
+ eval($eval);
// Starting time
$querytimeBefore = microtime(true);
incrementConfigEntry('sql_count');
// Debug output
- if ((getOutputMode() != 1) && (isDebugModeEnabled()) && (isConfigEntrySet('DEBUG_SQL')) && (getConfig('DEBUG_SQL') == 'Y')) {
+ if ((getOutputMode() != 1) && (isDebugModeEnabled()) && (isSqlDebuggingEnabled())) {
//
// Debugging stuff...
//
// Return row
return $row;
} else {
- // Return a false here...
+ // Return a false, else some loops would go endless...
return false;
}
}
SQL_SET_LINK($connect);
// Destroy cache
- unset($GLOBALS['sql_link_res']);
+ unset($GLOBALS['is_sql_link_up']);
}
// SQL select database
SQL_SET_LINK(null);
// Destroy cache
- unset($GLOBALS['sql_link_res']);
+ unset($GLOBALS['is_sql_link_up']);
// Return the result
return $close;
// Debugging
//
//* DEBUG: */ $fp = fopen(getConfig('CACHE_PATH') . 'escape_debug.log', 'a') or app_die(__FILE__, __LINE__, "Cannot write debug.log!");
- //* DEBUG: */ fwrite($fp, $F.'('.$L."): ".str_replace("\r", '', str_replace("\n", " ", $eval))."\n");
+ //* DEBUG: */ fwrite($fp, $F.'('.$L."): ".str_replace("\r", '', str_replace("\n", ' ', $eval))."\n");
//* DEBUG: */ fclose($fp);
if ($run === true) {
$linkUp = false;
// Do we have cached this?
- if (isset($GLOBALS['sql_link_res'])) {
+ if (isset($GLOBALS['is_sql_link_up'])) {
// Then use this
- $linkUp = $GLOBALS['sql_link_res'];
+ $linkUp = $GLOBALS['is_sql_link_up'];
} else {
// Get it
$linkUp = is_resource(SQL_GET_LINK());
// And cache it
- $GLOBALS['sql_link_res'] = $linkUp;
+ $GLOBALS['is_sql_link_up'] = $linkUp;
}
// Return the result