function SQL_QUERY ($sqlString, $F, $L, $enableCodes = true) {
// Do we have cache?
if (!isset($GLOBALS[__FUNCTION__][$sqlString])) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called: ' . $sqlString);
+
// Trim SQL string
$sqlStringModified = trim($sqlString);
// Cache it and remember as last SQL query
$GLOBALS[__FUNCTION__][$sqlString] = $sqlStringModified;
$GLOBALS['last_sql'] = $sqlStringModified;
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Stored cache: ' . $sqlStringModified);
} else {
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cache used!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cache used: ' . $sqlString);
// Use cache (to save a lot function calls
- $sqlString = $GLOBALS[__FUNCTION__][$sqlString];
+ $GLOBALS['last_sql'] = $GLOBALS[__FUNCTION__][$sqlString];
+
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cache is: ' . $sqlString);
}
// Starting time
if (SQL_NUMROWS($result) == 1) {
// Load entry
$content = SQL_FETCHARRAY($result);
+ //* DEBUG: */ print($id.'=<pre>'.print_r($content, true).'</pre>');
// Construct human-readable description
$ret = sprintf("%s (%s)", $content['descr'], $content['code']);