aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/config_default.inc.php3
-rw-r--r--include/functions.inc.php12
2 files changed, 14 insertions, 1 deletions
diff --git a/include/config_default.inc.php b/include/config_default.inc.php
index e441de35a..0a5a8e551 100644
--- a/include/config_default.inc.php
+++ b/include/config_default.inc.php
@@ -333,6 +333,9 @@ $conf['show_gt'] = true;
// accessed
$conf['debug_l10n'] = false;
+// die_on_sql_error: if an SQL query fails, should everything stop?
+$conf['die_on_sql_error'] = true;
+
// +-----------------------------------------------------------------------+
// | authentication |
// +-----------------------------------------------------------------------+
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 2fb4e3cba..496ad2690 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -651,12 +651,22 @@ function get_thumbnail_src($path, $tn_ext = '', $with_rewrite = true)
// error occured for the last mysql query.
function my_error($header)
{
+ global $conf;
+
$error = '<pre>';
$error.= $header;
$error.= '[mysql error '.mysql_errno().'] ';
$error.= mysql_error();
$error.= '</pre>';
- die ($error);
+
+ if ($conf['die_on_sql_error'])
+ {
+ die($error);
+ }
+ else
+ {
+ echo $error;
+ }
}
/**