Date: 08/31/00
- Next message: chang: "[PHP-DB] How could I read a CLOB in webpage?"
- Previous message: Tyson Lloyd Thwaites: "[PHP-DB] WIERD: odbc_fetch_row return value backwards?"
- Next in thread: Tyson Lloyd Thwaites: "Re: [PHP-DB] problem using odbc_fetch_row to count rows"
- Reply: Tyson Lloyd Thwaites: "Re: [PHP-DB] problem using odbc_fetch_row to count rows"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi all,
I am having some trouble resetting odbc_fetch_row.
I am using the following code to get the row count:
for ($i=0; odbc_fetch_row($this->qry, $i); $i++);
$this->rowcount = $i;
odbc_fetch_row($this->qry, 1); <<< this should
reset it, shouldn't it?
However, if I use that, any subsequent calls to odbc_result return the last
row (row $i), regardless of what I
pass to odbc_fetch_row.
The program flow goes like this:
while ($db->MoveNext()) {
for ($j=1; $j <= $db->GetColumnCount(); $j++) {
echo $db->GetValue($j);
}
}
MoveNext basically does $this->row++, and then calls
odbc_fetch_row($this->qry, $this->row).
$db->GetColumnCount() just returns odbc_result($this->qry, <param>).
If there are three rows, what I get is three lots of the last row. If I
remove that row counting bit and
just hardcode the rowcount into the loop, it works fine.
Any clues? Am I missing something dumb, or is PHP not updating the internal
row pointer properly?
Regards,
Tyson Lloyd Thwaites
IT&e Ltd
-- 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>
- Next message: chang: "[PHP-DB] How could I read a CLOB in webpage?"
- Previous message: Tyson Lloyd Thwaites: "[PHP-DB] WIERD: odbc_fetch_row return value backwards?"
- Next in thread: Tyson Lloyd Thwaites: "Re: [PHP-DB] problem using odbc_fetch_row to count rows"
- Reply: Tyson Lloyd Thwaites: "Re: [PHP-DB] problem using odbc_fetch_row to count rows"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

