From 8aa30d3ed20222bb9bce1e4dccd5af7e87a3749a Mon Sep 17 00:00:00 2001 From: shish Date: Thu, 17 May 2007 03:48:34 +0000 Subject: [PATCH] error-handling execute function git-svn-id: file:///home/shish/svn/shimmie2/trunk@107 7f39781d-f577-437e-ae19-be835c7a54ca --- core/database.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/database.class.php b/core/database.class.php index 16bca0ad..6e07fb18 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -55,6 +55,16 @@ class Database { return ceil($result->RecordCount() / $images_per_page); } } + + public function execute($query, $args) { + $result = $this->db->Execute($query, $args); + if($result === False) { + print "SQL Error: " . $this->db->ErrorMsg() . "
"; + print "Query: $query"; + exit; + } + return $result; + } // }}} // extensions {{{ public function set_extension_version($name, $version) {