Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2001011

Re: [PHP-DB] php4.0.4 and Interbase - fetching records across files From: Greg Kelley (gkelley <email protected>)
Date: 01/08/01

----- Original Message -----
From: "Greg Kelley" <gkelley <email protected>>
To: <php-db <email protected>>
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.

-- 
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>