// SQL queries
function SQL_QUERY ($sql_string, $F, $L) {
// Link is up?
- if (!SQL_IS_LINK_UP()) return false;
+ if (!SQL_IS_LINK_UP()) {
+ // We should not quietly ignore this!
+ trigger_error(sprintf("Cannot query database: sql_string=%s,file=%s,line=%s",
+ $sql_string,
+ basename($F),
+ $L
+ ));
+
+ // Return 'false' because it has failed
+ return false;
+ } // END - if
// Remove \t, \n and \r from queries they may confuse some MySQL version I have heard
$sql_string = str_replace("\t", " ", str_replace("\n", " ", str_replace("\r", " ", $sql_string)));
// Run SQL command
//* DEBUG: */ echo $sql_string."<br />\n";
$result = mysql_query($sql_string, SQL_GET_LINK())
- or addFatalMessage(__FUNCTION__, __LINE__, $F." (".$L."):".mysql_error()."<br />
+ or addFatalMessage(__FUNCTION__, __LINE__, $F." (".$L."):".mysql_error()."<br />
Query string:<br />
".$sql_string);