X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fdb%2Fconnect_db.inc;h=fd6870e947ed121d58ec558a13a00561b523c3f5;hb=ec09689a87c0b0bac3c24e782ae4e5dfe7a6248e;hp=7de0c108954af0290cc93fc04e5ef4854ed48953;hpb=818719f38b8327cdca616d58b13913dbd174d96a;p=fa-stable.git diff --git a/includes/db/connect_db.inc b/includes/db/connect_db.inc index 7de0c108..fd6870e9 100644 --- a/includes/db/connect_db.inc +++ b/includes/db/connect_db.inc @@ -1,15 +1,14 @@ . + See the License here . ***********************************************************************/ -set_global_connection(); function set_global_connection() { @@ -27,8 +26,8 @@ $db_duplicate_error_code = 1062; function db_query($sql, $err_msg=null) { - global $db, $show_sql, $sql_trail, $select_trail; - + global $db, $show_sql, $sql_trail, $select_trail, $go_debug; + //echo "
$sql
"; if ($show_sql) { @@ -50,12 +49,13 @@ function db_query($sql, $err_msg=null) } } - if ($err_msg != null) - if (function_exists('xdebug_call_file')) - check_db_error('
At file '.xdebug_call_file().':'.xdebug_call_line().':
'.$err_msg, $sql); - else - check_db_error($err_msg, $sql); - + if ($err_msg != null || $go_debug) { + $exit = $err_msg != null; + if (function_exists('xdebug_call_file')) + check_db_error('
At file '.xdebug_call_file().':'.xdebug_call_line().':
'.$err_msg, $sql, $exit); + else + check_db_error($err_msg, $sql, $exit); + } return $result; }