Welcome Guest, Not a member yet? Register   Sign In
Extend Exceptions Class for DB Errors
#2

[eluser]Pascal Kriete[/eluser]
Here we go, this version works properly.
Code:
function display_error($error = '', $swap = '', $native = FALSE)
{
    $LANG =& load_class('Language');
    $LANG->load('db');

    $heading = 'Database Error';

    if ($native == TRUE)
    {
        $message = $error;
    }
    else
    {
        $message = ( ! is_array($error)) ? array(str_replace('%s', $swap, $LANG->line($error))) : $error;
    }

    $EXC =& load_class('Exceptions');
    echo $EXC->show_error($heading, $message, 'error_db');
    exit;
}


Messages In This Thread
Extend Exceptions Class for DB Errors - by El Forum - 04-11-2008, 07:41 AM
Extend Exceptions Class for DB Errors - by El Forum - 04-11-2008, 08:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB