From 3b907b85a51d489a6a752da80aaddcd854d9e878 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Fri, 25 Jan 2013 09:00:58 +0100 Subject: Use print_error function for query error display --- sqlbox/locallib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sqlbox/locallib.php') diff --git a/sqlbox/locallib.php b/sqlbox/locallib.php index 3916d34..359d5ae 100644 --- a/sqlbox/locallib.php +++ b/sqlbox/locallib.php @@ -40,10 +40,12 @@ defined('MOODLE_INTERNAL') || die(); //} function db_table_from_query($db, $query) { + global $PAGE; + $table = new html_table; $result = @pg_query($db, $query); if (!$result) - error("Query failed: ".pg_last_error($db)); + print_error('queryfailed', 'sqlbox', $PAGE->url, pg_last_error($db)); $table = new html_table; $n = pg_num_fields($result); -- cgit