|
include_once "db.php";
$db = $conn;
// Trigger an error condition
function showerror($failed_query='unknown',$source_file='unknown') {
global $connection;
$myqueryerror = mysqli_error($db);
$myqueryerrorno = mysqli_errno($db);
$failed_query = mysqli_real_escape_string($db, $failed_query);
$logquery = "INSERT INTO mysql_errors (failed_query, mysql_error_text, source_file) VALUES ('".$failed_query."','".$myqueryerror."','".$source_file."')";
$logresult = mysqli_query ($db, $logquery);
//echo $myqueryerror;
// just tell the user nothing to prevent info that could be used against us
trigger_error("Store system error", E_USER_ERROR);
}
// Abort on error. Deletes session variables to leave
// us in a clean state
function errorHandler($errno, $errstr, $errfile, $errline) {
// switch ($errno) {
// case E_USER_NOTICE:
// case E_USER_WARNING:
// case E_WARNING:
// case E_NOTICE:
// case E_CORE_WARNING:
// case E_CORE_NOTICE:
// case E_COMPILE_WARNING:
// break;
// case E_USER_ERROR:
// case E_ERROR:
// case E_PARSE:
// case E_CORE_ERROR:
// case E_COMPILE_ERROR:
// session_start();
// if (isset($_SESSION["message"]))
// unset($_SESSION["message"]);
// if (isset($_SESSION["order_no"]))
// unset($_SESSION["order_no"]);
// //errorString = "Store system error: $errstr (# $errno).
\n" . "Please report the following to the administrator:
\n";
// $errorString = $errstr."
\n";
// // Send the error to the administrator by email
// // error_log($errorString, 1, "youremail@youraddress.com");
//
// // Stop the system
// die;
// break;
// }
}
?>