includes/dbal.php
changeset 15 ad5986a53197
parent 1 fe660c52c48f
child 16 64e0d3d4cf14
equal deleted inserted replaced
14:ce6053bb48d8 15:ad5986a53197
    78   function _die($t = '') {
    78   function _die($t = '') {
    79     if(defined('ENANO_HEADERS_SENT')) {
    79     if(defined('ENANO_HEADERS_SENT')) {
    80       ob_clean();
    80       ob_clean();
    81     }
    81     }
    82     header('HTTP/1.1 500 Internal Server Error');
    82     header('HTTP/1.1 500 Internal Server Error');
    83     $bt = $this->sql_backtrace();
    83     $bt = $this->latest_query; // $this->sql_backtrace();
    84     $e = htmlspecialchars(mysql_error());
    84     $e = htmlspecialchars(mysql_error());
    85     if($e=='') $e='<none>';
    85     if($e=='') $e='<none>';
    86     if(defined('ENANO_CONFIG_FETCHED')) die_semicritical('Database error', '<h3>An error occurred during a database query.</h3><p>'.$t.'<br />Error returned by MySQL: '.$e.'<br />SQL Backtrace:</p><pre>'.$bt.'</pre>');
    86     if(defined('ENANO_CONFIG_FETCHED')) die_semicritical('Database error', '<h3>An error occurred during a database query.</h3><p>'.$t.'<br />Error returned by MySQL: '.$e.'<br />SQL Backtrace:</p><pre>'.$bt.'</pre>');
    87     else                                   grinding_halt('Database error', '<h3>An error occurred during a database query.</h3><p>'.$t.'<br />Error returned by MySQL: '.$e.'<br />SQL Backtrace:</p><pre>'.$bt.'</pre>');
    87     else                                   grinding_halt('Database error', '<h3>An error occurred during a database query.</h3><p>'.$t.'<br />Error returned by MySQL: '.$e.'<br />SQL Backtrace:</p><pre>'.$bt.'</pre>');
    88     exit;
    88     exit;