summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Page2008-08-26 21:35:18 +0000
committerDave Page2008-08-26 21:35:18 +0000
commit737568dfd57fe0d866894adf7774f83ea65da79f (patch)
treed2d5d79d19275107b171c9e8ffd96757c9c115e1
parent161e2432fd8bd0950fbd8c5066c2729f6ae4bea2 (diff)
Fix numbering.
-rw-r--r--results.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/results.php b/results.php
index 0460823..4815a0b 100644
--- a/results.php
+++ b/results.php
@@ -53,7 +53,8 @@ $rownum = 0;
// Store metadata for future use
$_SESSION['column_count'] = pg_num_fields($res);
-$_SESSION['row_count'] = pg_num_rows($res);
+$_SESSION['actual_rows'] = pg_num_rows($res);
+$_SESSION['row_count'] = ($_SESSION['actual_rows'] < $GLOBALS['config_max_result_rows']) ? $_SESSION['actual_rows'] : $GLOBALS['config_max_result_rows'];
// Column names
for ($x = 0; $x < $_SESSION['column_count']; $x++) {
@@ -69,15 +70,15 @@ while (($row = pg_fetch_array($res)) && ($rownum < $GLOBALS['config_max_result_r
// Display the results
if ($_SESSION['column_count'] > 0) {
- $message = "Rows: " . $_SESSION['row_count'];
+ $message = "Rows: " . $_SESSION['actual_rows'];
- if ($_SESSION['row_count'] > $GLOBALS['config_max_result_rows'])
- $message .= " (limited to " . $GLOBALS['config_max_result_rows'] . ")";
+ if ($_SESSION['actual_rows'] != $_SESSION['row_count'])
+ $message .= " (limited to " . $_SESSION['row_count'] . ")";
for ($x = 0; $x < $_SESSION['row_count']; $x++) {
// Set the sub-panel ID
- $subpanel = $panel . "row" . $x + 1;
+ $subpanel = $panel . "row" . ($x + 1);
// Build the row preview list.
$list .= "<li class=\"double\"><a href=\"#" . $subpanel . "\">";
@@ -94,7 +95,7 @@ if ($_SESSION['column_count'] > 0) {
// Build the panel for this row
$divs .= "<div id=\"" . $subpanel . "\" class=\"panel\" title=\"Query row\">";
- $divs .= "<div class=\"dialogHeader\">Row: " . $x . "</div>";
+ $divs .= "<div class=\"dialogHeader\">Row: " . ($x + 1) . "</div>";
for ($y = 0; $y < $_SESSION['column_count']; $y++) {
$divs .= "<h2>" . $_SESSION['columns'][$y] . "</h2><div class=\"valueBox\">" . www_clean(truncate_value($_SESSION['rows'][$x][$y])) . "</div>";