format problems on postgresql query?
| From: | mark dot christenson at alumni dot stanford dot org | Date: | Fri, 15 Dec 2000 00:54:16 +0000 |
| Subject: | format problems on postgresql query? | ||
| Groups: | php.db php.general | ||
| Request: | Send a blank email to php-general+get-30421@lists.php.net to get a copy of this message | ||
I'm getting some behavior that I can't figure out. I make a query, then display it in a
table using the code below. I end up with half the resulting page as space, before the actual
results start to show up. If I limit the result to one row, there's one row of space then the
result row. If I limit the result to 2 rows, then I get two rows of space and then two result rows.
And so on. If a put an echo "text"; line in the for {} block then it gets repeated as
many times as rows are returned, but prior to any of the result rows from the database being
returned.
If anybody doesn't understand what I'm describing, you can view the page at http://www.markchristenson.com/phphelp.php
TIA,
Mark
for ($k=0; $k<$numrows4; $k++) {
$arr = pg_fetch_array($result4, $k);
$resultbottlecount2 = pg_Exec($dbconn, "select countonewine($arr[wineid])");
$arrbottlecount2 = pg_fetch_array($resultbottlecount2, 0);
echo "<TD>" . $arrbottlecount2[0] . "</TD>";
$arr = pg_fetch_array($result4, $k);
echo "<TD>" . $arr["wineid"] . "</TD>";
$arr = pg_fetch_array ($result4, $k);
echo "<TD>" . $arr["vintage"] . "</TD>";
$arr = pg_fetch_array ($result4, $k);
echo "<TD>" . $arr["label"] . "</TD>";
$arr = pg_fetch_array ($result4, $k);
echo "<TD>" . $arr["appellation"] . "</TD>";
$arr = pg_fetch_array ($result4, $k);
echo "<TD>" . $arr["varietal"] . "</TD>";
echo "</TR>";
echo "<BR>";
}
----------------------------------------------
E-mail@stanfordalumni.org is brought to you by
the Stanford Alumni Association and Critical Path.