// Link is up?
if (!SQL_IS_LINK_UP()) {
// We should not quietly ignore this!
- debug_report_bug(sprintf("Cannot query database: sqlString=%s,file=%s,line=%s",
+ debug_report_bug(__FUNCTION__, __LINE__, sprintf("Cannot query database: sqlString=%s,file=%s,line=%s",
$sqlString,
basename($F),
$L
return false;
} elseif (empty($sqlString)) {
// Empty SQL string!
- debug_report_bug(sprintf("SQL string is empty. Please fix this. file=%s, line=%s",
+ debug_report_bug(__FUNCTION__, __LINE__, sprintf("SQL string is empty. Please fix this. file=%s, line=%s",
basename($F),
$L
));
// Run SQL command
//* DEBUG: */ print('F=' . basename($F) . ',L=' . $L . 'sql=' . htmlentities($sqlString) . '<br />');
$result = mysql_query($sqlString, SQL_GET_LINK())
- or debug_report_bug('[' . __FUNCTION__ . ':' . __LINE__ . '] ' . $F . ' (' . $L . '):' . mysql_error() . "\n".
+ or debug_report_bug(__FUNCTION__, __LINE__, 'file='. $F . ',line=' . $L . ':mysql_error()=' . mysql_error() . "\n".
'Query string:' . $sqlString);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sql=' . $sqlString . ',numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS());
//
// Debugging stuff...
//
- $fp = fopen(getConfig('CACHE_PATH') . 'mysql.log', 'a') or app_die(__FILE__, __LINE__, 'Cannot write mysql.log!');
+ $fp = fopen(getConfig('CACHE_PATH') . 'mysql.log', 'a') or debug_report_bug(__FUNCTION__, __LINE__, 'Cannot write mysql.log!');
if (!isset($GLOBALS['sql_first_entry'])) {
// Write first entry
fwrite($fp, 'Module=' . getModule() . "\n");
// Debugging
//
- //* DEBUG: */ $fp = fopen(getConfig('CACHE_PATH') . 'escape_debug.log', 'a') or app_die(__FILE__, __LINE__, "Cannot write debug.log!");
+ //* DEBUG: */ $fp = fopen(getConfig('CACHE_PATH') . 'escape_debug.log', 'a') or debug_report_bug(__FUNCTION__, __LINE__, "Cannot write debug.log!");
//* DEBUG: */ fwrite($fp, $F.'('.$L."): ".str_replace("\r", '', str_replace("\n", ' ', $eval))."\n");
//* DEBUG: */ fclose($fp);
// Is columns an array?
if (!is_array($columns)) {
// No array
- debug_report_bug(sprintf("columns is not an array. %s != array, file=%s, line=%s",
+ debug_report_bug(__FUNCTION__, __LINE__, sprintf("columns is not an array. %s != array, file=%s, line=%s",
gettype($columns),
basename($F),
$L
// Get column information
$result = SQL_QUERY_ESC("SHOW COLUMNS FROM `%s` LIKE '%s'",
- array($tableName, $columnName), __FILE__, __LINE__);
+ array($tableName, $columnName), __FUNCTION__, __LINE__);
// Do we have no entry on ADD or an entry on DROP?
// 123 4 4 3 3 4 4 32 23 4 4 3 3 4 4 321
} // END - if
// Show indexes
- $result = SQL_QUERY_ESC("SHOW INDEX FROM `%s`", array($tableName), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SHOW INDEX FROM `%s`", array($tableName), __FUNCTION__, __LINE__);
// Non-skipping is default for ADD
$skip = false;
// Is this a resource or null?
if ((!is_resource($link)) && (!is_null($link))) {
// This should never happen!
- debug_report_bug(sprintf("link is not resource or null. Type: %s", gettype($link)));
+ debug_report_bug(__FUNCTION__, __LINE__, sprintf("link is not resource or null. Type: %s", gettype($link)));
} // END - if
// Set it