Re: php4.0.4 and Interbase - fetching records across files
| From: | Greg Kelley | Date: | Mon, 08 Jan 2001 20:01:08 +0000 |
| Subject: | Re: php4.0.4 and Interbase - fetching records across files | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-5717@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "Greg Kelley" <gkelley@londavia.com>
To: <php-db@lists.php.net>
Sent: January 08, 2001 11:14 AM
Subject: [PHP-DB] php4.0.4 and Interbase - fetching records across files
I'm trying to fetch multiple records, one at a time (like I have done with
MySQL and PostgreSQL) by storing the result set id to a session id. Then I
recall the same php file using a Next Button and get the next record from
the result set. Interbase doesn't like this at all...
<--snip-->
I have found a solution to the sequential record fetch as follows:
if ($site != "Next") { <- This is true if the .php file was called from a
Next Button
$rcd = ibase_fetch_object($rslt);
$row = 1; <- first time thru set $row to 1
} else {
$nrow = 1;
while ($rcd = ibase_fetch_object($rslt))
{
if ($nrow == ($row + 1))
{
$row = $nrow;
break;
} else {
$nrow = ($nrow + 1);
}
}
}
I store $row to a session variable, then fetch records until I get the one
after the last one I selected.