summaryrefslogtreecommitdiff
path: root/sqlbox/view.php
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-11-21 12:04:06 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-11-21 12:08:30 +0100
commitce4fa77b60ed3aad6dcd09dbd48fd7b119bc1261 (patch)
treebce217cb733d4b77dcc9affcd3f1ab57dfbfec07 /sqlbox/view.php
parent04e6e490862db2c164526b3aede92c7e9d8eb316 (diff)
downloadsqltutor-plugin-ce4fa77b60ed3aad6dcd09dbd48fd7b119bc1261.tar.gz
sqltutor-plugin-ce4fa77b60ed3aad6dcd09dbd48fd7b119bc1261.tar.bz2
sqltutor-plugin-ce4fa77b60ed3aad6dcd09dbd48fd7b119bc1261.zip
sqlbox: Show query field names
Diffstat (limited to 'sqlbox/view.php')
-rw-r--r--sqlbox/view.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/sqlbox/view.php b/sqlbox/view.php
index 8cf6848..dd20fb9 100644
--- a/sqlbox/view.php
+++ b/sqlbox/view.php
@@ -89,6 +89,10 @@ if (isset($data->query)) {
error("Query failed!");
echo "<table border=\"1\">";
+ $n = pg_num_fields($result);
+ for ($i = 0; $i < $n; $i++) {
+ echo "<th>".pg_field_name($result, $i)."</th>";
+ }
while($row=pg_fetch_row($result)){
echo "<tr>";
foreach($row as $val) {