diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-11-21 12:04:06 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-11-21 12:08:30 +0100 |
commit | ce4fa77b60ed3aad6dcd09dbd48fd7b119bc1261 (patch) | |
tree | bce217cb733d4b77dcc9affcd3f1ab57dfbfec07 | |
parent | 04e6e490862db2c164526b3aede92c7e9d8eb316 (diff) | |
download | sqltutor-plugin-ce4fa77b60ed3aad6dcd09dbd48fd7b119bc1261.tar.gz sqltutor-plugin-ce4fa77b60ed3aad6dcd09dbd48fd7b119bc1261.tar.bz2 sqltutor-plugin-ce4fa77b60ed3aad6dcd09dbd48fd7b119bc1261.zip |
sqlbox: Show query field names
-rw-r--r-- | sqlbox/view.php | 4 |
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) { |