From e465d1a2e29f90cbd125573cc2ec3ae4f1c64ce3 Mon Sep 17 00:00:00 2001 From: jurgbohn <> Date: Tue, 21 Apr 2009 18:06:55 +0000 Subject: [PATCH] Added reportError to web --- web/database.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/web/database.php b/web/database.php index 262a2485..ee0c952f 100644 --- a/web/database.php +++ b/web/database.php @@ -19,6 +19,7 @@ */ + if(!file_exists(dirname(__FILE__) . "/config.php")) { die("Please run the Install script to configure your installation"); } @@ -31,4 +32,16 @@ if (PEAR::isError($mdb2)) { die($mdb2->getMessage()); } +function reportError($text, $data) { + // make a fresh connection + $mdbe = MDB2::connect($connect_string); + if (PEAR::isError($mdbe)) { + die($mdbe->getMessage()); + } + + $mdbe->exec("INSERT INTO Error (msg, data, time) VALUES (" + . $mdbe->quote($text, 'text') . ", " + . $mdbe->quote($data, 'text') . ", " + . time() . ")"); +} ?> -- GitLab