php4.0.4 and Interbase - fetching records across files
| From: | Greg Kelley | Date: | Mon, 08 Jan 2001 16:14:14 +0000 |
| Subject: | php4.0.4 and Interbase - fetching records across files | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-5708@lists.php.net to get a copy of this message | ||
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. It
stores a 0 to the result set session variable - it's like it disconnects after one fetch! Here
is a bit of code to illustrate:
if ($site != "Next") {
$sql="SELECT * FROM COMPANY_SITES LEFT JOIN COMPANIES ON COMPANY_SITES.CMP_AUTO_KEY =
COMPANIES.CMP_AUTO_KEY WHERE COMPANIES.CV_UDF_013='".$pass."' ORDER BY
SITE_DESCRIPTION";
$conn = ibase_connect ($host, $user, $pwd, 'ISO8859_1', 100, 1);
$qry = ibase_prepare ($conn, $sql);
$rslt = ibase_execute ($qry); <- Result id#3 is the value of $rslt here
$rcd = ibase_fetch_object ($rslt);
} else {
$rcd = ibase_fetch_object ($rslt);
}
<- zero (0) is the value of $rslt here after one fetch!
Here is the Button:
<form action='cssite.php' name='Track'>
<p><input type="submit" name="site" value="Next">
</form>
The first time the .php file is called, it processes the whole connection. Each time thereafter, it
should just do a fetch based on the stored $rslt value (stored in the usual session variable way).
Does anyone know of a 'correct' way to fetch multiple records one at a time over different
.php files?
Thanks for any insights - this one has me stumped...
________________________
Greg Kelley, IT Director
Londavia, Inc.
Pease Int'l Tradeport
68 New Hampshire Ave.
Portsmouth, NH 03801
603.766.3005
http://www.londavia.com
SSA, EAA, AOPA, N5506M