$sqlString = str_replace('{PER}', '%', $sqlString);
// Compile config entries out
- $eval = '$sqlString = "' . FILTER_COMPILE_CONFIG(escapeQuotes($sqlString)) . '";';
- eval($eval);
+ $sqlString = SQL_PREPARE_SQL_STRING($sqlString);
// Starting time
$querytimeBefore = microtime(true);
return (SQL_NUMROWS($result) === 0);
}
+// Private function to prepare the SQL query string
+function SQL_PREPARE_SQL_STRING ($sqlString) {
+ // Is it already cached?
+ if (!isset($GLOBALS['sql_strings'][$sqlString])) {
+ // No, then generate the eval() command
+ $eval = '$sql = "' . FILTER_COMPILE_EXPRESSION_CODE(FILTER_COMPILE_CONFIG(escapeQuotes($sqlString))) . '";';
+ eval($eval);
+
+ // ... and set it
+ $GLOBALS['sql_strings'][$sqlString] = $sql;
+ } // END - if
+
+ // Return it
+ return $GLOBALS['sql_strings'][$sqlString];
+}
+
// [EOF]
?>