Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2000121

[PHP-DB] format problems on postgresql query? From: mark.christenson <email protected>
Date: 12/14/00

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 <email protected> is brought to you by
the Stanford Alumni Association and Critical Path.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>