summaryrefslogtreecommitdiff
path: root/sqlbox/view.php
diff options
context:
space:
mode:
authorJan Klemkow <j.klemkow@wemelug.de>2012-11-21 13:34:09 +0100
committerJan Klemkow <j.klemkow@wemelug.de>2012-11-21 13:34:09 +0100
commit0b3e94f02d5c4cfcfb93a90896881652eceafc55 (patch)
tree52f24cfcdc2c21d814f080f1ee79f2489f14c304 /sqlbox/view.php
parente6d9384cfa1af9c69636b4bc6bf1108327ea3085 (diff)
downloadsqltutor-plugin-0b3e94f02d5c4cfcfb93a90896881652eceafc55.tar.gz
sqltutor-plugin-0b3e94f02d5c4cfcfb93a90896881652eceafc55.tar.bz2
sqltutor-plugin-0b3e94f02d5c4cfcfb93a90896881652eceafc55.zip
Add additional error string from database.
Diffstat (limited to 'sqlbox/view.php')
-rw-r--r--sqlbox/view.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/sqlbox/view.php b/sqlbox/view.php
index 1158d7b..d334835 100644
--- a/sqlbox/view.php
+++ b/sqlbox/view.php
@@ -84,7 +84,10 @@ if (isset($data->sqlbox_query)) {
if (!db)
error("Failed to connect to sqlbox db");
- $result = pg_query($db, $data->sqlbox_query);
+// $result = pg_query($db, $data->sqlbox_query);
+ $result = pg_send_query($db, $data->sqlbox_query);
+ $result = pg_get_result($db);
+ echo pg_result_error_field($result, PGSQL_DIAG_SQLSTATE);
if (!$result)
error("Query failed!");