Hi!
I'm having a little problem that drove me crazy for a couple of days. If i try to call ibase_fetch_object from a function a get allways:
Warning: Interbase. Invalid statement handle
at the third time that ibase_fetch_object is called.
Feedback: I had a web page where i showed some data from a table, everything was Ok. One day i decided rebuild the page using functions, only for a better looking and a easier maintenance. But what happened, i started to get the error message above. I've been fooling around for some days and the error desappeared when a moved away the loop with the call to ibase_fetch_object. Later i changed for a do{}while instead of a while{}, but still i got the same error; until i decided to try ibase_fetch_object() inside the function, without a loop. Then the error message desappeared; then i added a new call, no error; then i added the third call, and the error again.
I wonder if somebody else had something similar, and how he solved. Here there's the code:
$dbh = ibase_connect ('/home/users/bdarder/programacion/basesDeDatos/pruebas/pruebas.gdb','SYSDBA','masterkey');
$stmt = 'SELECT * FROM TB_PRINC';
$sth = ibase_query ($dbh, $stmt);
while ($row = ibase_fetch_row ($sth)) {
print $row[0] . " ";
print $row[1] . "\n ";
}
ibase_close ($dbh);
Don't mind about the database, i tried different databases in different servers and i got the same error. Also i move from ibase_fetch_object to ibase_fetch_row and i got the same error.
Many thanks for your attention.
Beni.
I'm having a little problem that drove me crazy for a couple of days. If i try to call ibase_fetch_object from a function a get allways:
Warning: Interbase. Invalid statement handle
at the third time that ibase_fetch_object is called.
Feedback: I had a web page where i showed some data from a table, everything was Ok. One day i decided rebuild the page using functions, only for a better looking and a easier maintenance. But what happened, i started to get the error message above. I've been fooling around for some days and the error desappeared when a moved away the loop with the call to ibase_fetch_object. Later i changed for a do{}while instead of a while{}, but still i got the same error; until i decided to try ibase_fetch_object() inside the function, without a loop. Then the error message desappeared; then i added a new call, no error; then i added the third call, and the error again.
I wonder if somebody else had something similar, and how he solved. Here there's the code:
$dbh = ibase_connect ('/home/users/bdarder/programacion/basesDeDatos/pruebas/pruebas.gdb','SYSDBA','masterkey');
$stmt = 'SELECT * FROM TB_PRINC';
$sth = ibase_query ($dbh, $stmt);
while ($row = ibase_fetch_row ($sth)) {
print $row[0] . " ";
print $row[1] . "\n ";
}
ibase_close ($dbh);
Don't mind about the database, i tried different databases in different servers and i got the same error. Also i move from ibase_fetch_object to ibase_fetch_row and i got the same error.
Many thanks for your attention.
Beni.