} // END - if
// Append debug line
- appendLineToFile(getCachePath() . 'mysql.log', basename($F) . '|LINE=' . $L . '|NUM=' . (is_resource($result) ? SQL_NUMROWS($result) : 'false') . '|AFFECTED=' . SQL_AFFECTEDROWS() . '|QUERYTIME:' . $queryTime . '): ' . str_replace(array(chr(13), chr(10)), array('', ' '), $GLOBALS['last_sql']));
+ appendLineToFile(getCachePath() . 'mysql.log', basename($F) . '|LINE=' . $L . '|NUM=' . (is_resource($result) ? SQL_NUMROWS($result) : 'false') . '|AFFECTED=' . SQL_AFFECTEDROWS() . '|QUERYTIME:' . ($queryTime * 1000) . 'ms): ' . str_replace(array(chr(13), chr(10)), array('', ' '), $GLOBALS['last_sql']));
} // END - if
// Increment stats entry
}
// SQL fetch array
-function SQL_FETCHARRAY ($res) {
+function SQL_FETCHARRAY ($resource) {
// Is a result resource set?
- if ((!is_resource($res)) || (!SQL_IS_LINK_UP())) return false;
+ if ((!is_resource($resource)) || (!SQL_IS_LINK_UP())) return false;
// Load row from database
- $row = mysql_fetch_assoc($res);
+ $row = mysql_fetch_assoc($resource);
// Return only arrays here
if (is_array($row)) {
// Escape a string for the database
function SQL_ESCAPE ($str, $secureString = true, $strip = true) {
// Do we have cache?
- if (!isset($GLOBALS['sql_escapes'][''.$str.''])) {
+ if (!isset($GLOBALS['sql_escapes']['' . $str . ''])) {
// Prepare the string here
$str = SQL_PREPARE_SQL_STRING($str);
}
// Cache result
- $GLOBALS['sql_escapes'][''.$str.''] = $ret;
+ $GLOBALS['sql_escapes']['' . $str . ''] = $ret;
} // END - if
// Return it
- return $GLOBALS['sql_escapes'][''.$str.''];
+ return $GLOBALS['sql_escapes']['' . $str . ''];
}
// SELECT query string from table, columns and so on... ;-)