|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-11-13 04:41 UTC] opolette at yahoo dot com
When exiting a function after having closed a link to Interbase, the warning "Invalid statement handle" is displayed. apparently, PHP tries to close the connection by itself even if it has already been closed, which raises this warning from interbase.
Example :
<?php
function foo() {
$link = ibase_connect("//ibase/mybase", "login", "password");
.... // some code here
ibase_close ($link);
return -1; // generates the warning
}
$x = foo(); // warning displayed
>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 22:00:01 2025 UTC |
Apparently, it has not been reported that this problem is now again in version 7.0 (at least, I have not checked 7.1). For 3 years this statement: while($fl = ibase_fetch_object($res)) { // $res = sql with 17 columns and a maximum of 30 rows } had been working seamlessly in up to version 5.6. As the app is now in a server with php 7.0, this is the only statement failing (so far).I discovered where the problem was. I versions prior to 7.0, it was possible to execute ibase_connect( ... ) a second (or third time or more) without anything like this happening. In version 7.0, if a function tries to execute ibase_connect() then the environment from where such function was called loses values of variables and can not continue. As the function called, which executed a second ibase_connect in one POST, returns, then the previous environment breaks. I had this: while(($fl = ibase_fetch_object($res)) !== NULL) { glGetThat(); } function glGetThat() had a connection, which would be redundant, but after it returned from glGetThat() then $res had lost the value it had to continue retrieving the query results. I hope this is useful, because a non-documented change has happened in version 7.0 which affects the way ibase_connect() behaves.